In C# 11, you'll be able to put the required keyword on properties (and fields? and other things?). This will indicate that it may not be initialized via constructor, but that the compiler does not need to warn you about not assigning a non-null value to it, because that will be done (and enforced) in object-initializer syntax.
Mads made it clear that this isn't meant to replace constructors, just trying to make object-initializer syntax easier to work with.
In C# 11, you'll be able to put the
required
keyword on properties (and fields? and other things?). This will indicate that it may not be initialized via constructor, but that the compiler does not need to warn you about not assigning a non-null value to it, because that will be done (and enforced) in object-initializer syntax.Mads made it clear that this isn't meant to replace constructors, just trying to make object-initializer syntax easier to work with.