In my server, my field “Name” is marked as [Required] so EntityFramework can mark it as non nullable on the migration:
public class MyClass
{
[Required]
public string CreatedBy {get;set;}
}
But the “CreatedBy” field is set at creation on the server, so the first time it must travel as NULL from the client
So I get a serialization error:
https://tools.ietf.org/html/rfc7231#section-6.5.1
[‘The CreatedBy field is required.’]
How do I declare the CreatedBy field to be null for serialization but non null for database?