I came across this today in a WCF contract:
[DataMember(IsRequired = true)]
public DateTime? LastModified { get; set; }
What are the consequences of IsRequired = True
and a nullable DateTime
? They appear to be contradictory to each other.
I came across this today in a WCF contract:
[DataMember(IsRequired = true)]
public DateTime? LastModified { get; set; }
What are the consequences of IsRequired = True
and a nullable DateTime
? They appear to be contradictory to each other.
It can make sense if you want to initialize it with null and let user to set a valid date. So before submitting it can validate user input.
Here is a similar contradictory that may answer your question.
Interaction with IsRequired