Base solution for your next web application
Open Closed

Override AbpUser attributes #946


User avatar
0
noah created

In the AbpUser class, the "Name" and "Surname" fields are marked as Required by an attribute. I'm not sure why this would be enforced, as it is often valid to have a user without both name components, especially during registration. How can I inherit from AbpUser but without the Required validation on these fields? Thanks.


1 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    You can overload OnModelCreating method of your dbcontext and override these properties via fluent api. You can find many documents on the web for it. Note that: call base.OnModelCreating as first line in your overrided method.