Constructors in C# — a practical guide to C# constructors with clear examples you can reuse in real projects.
C# Tutorial Series (52/121). Prefer one article? Read the complete C# tutorial.
Short description
Validate inputs; prefer required properties / init where suitable.
Constructor
class User
{
public User(string name) => Name = name;
public string Name { get; }
}