Base solution for your next web application
Open Closed

Modifying User table #4156


User avatar
0
soonjoo created

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)
  • User Avatar
    0
    aaron created
    Support Team

    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; }
    
  • User Avatar
    0
    soonjoo created

    Thank you for your help @aaron