Hello team,
Currently for the User table, Surname and First name is required, what is the best way to change it to optional instead? also I would like to make full name required. I can only think of using the OnModelCreating, or is there another way to override the attributes?
Thank you.
2 Answer(s)
-
0
Currently for the User table, Surname and First name is required, what is the best way to change it to optional instead?
In general, it may not possible due to a limitation (feature) of the Required attribute. Related issue: https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1274
Can you check if the workaround (to allow empty strings) just posted there works?
also I would like to make full name required.
This should not be a problem:
[Required] public override string FullName { get; set; }
-
0
Thank you for your help @aaron