Base solution for your next web application
Open Closed

how to extending user by adding navigational property #1631


User avatar
0
andry3ag created

I am wondering what is the best way to add navigational property that reference a entity in a module in Core\Authorization\Users\User.cs.

The problem I am encountering is that the module normally reference the core project, and therefore the core project can not reference to the module project. Because it will create circular reference. So what is the best way to deal with it?

derek


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

    Hi,

    This is a tough topic actually, it's hard to give an exact answer.

    But you can create another User class deriving from User Entity (which is in Core module) in your module which contains navigation property Entity, then add the navigation property.

    In order to allow application to create base User entity, all properties added by other modules must be optional (nullable) or must have a default value.