It would be nice if the required modifier could be considered a way of making properties required. You could think of the following:
classModel{publicrequiredstringMakeRequired{get;init;}// When analyzing this property, add a default instance of a RequiredAttribute to the list of validation attributes/publicrequiredintValueType{get;init;}// Ignore, adding a required attribute will not change a thing.publicrequiredstring?NullableReference{get;init;}// Ingore, it must be set, but null is considered valid option.[Any]publicrequiredint[]SomeObject{get;init;}// Ignore, AnyAttribute inherits from RequiredAttribute and should prevail.}What do you think?
It would be nice if the
requiredmodifier could be considered a way of making properties required. You could think of the following:What do you think?