C Sharp (C#) - Properties and Encapsulation
You want to create an immutable record-like class with properties set only once during creation. Which approach best uses init-only setters to achieve this?
How should you create and set properties for a Product instance?
public class Product {
public string Name { get; init; }
public decimal Price { get; init; }
}How should you create and set properties for a Product instance?
