Base solution for your next web application
Open Closed

Extending AbpUser object #221


User avatar
0
naeazach created

First of all, I'd like to thank you for an excellent starter project. I had been developing and using something similar the last few years but no where near this built out. You literally saved me a few months of frustration on my current project.

Please excuse my ignorance as I'm used to using DataFirst Entity Objects so extending/adding a table is obviously much simpler with an EDMX in the project. What I'd like to do is one of the following:

Extend the User object to add profile info (company, addr info, etc). Add a UserProfile table with a parent relationship to the user table.

Any suggestion on where to achieve this in the project?


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

    Hi,

    Thank you so much :)

    Actually, it's simple. You have a User class in .Core project. Just add new properties here. Then run Add-Migration command (like <a class="postlink" href="http://www.aspnetzero.com/Documents/Developing-Step-By-Step#database-migrations">http://www.aspnetzero.com/Documents/Dev ... migrations</a>).

    Also, you can create a new entity class UserProfile (inherits from Entity<long>) and add a navigation property to User entity (like Phone to Person here: <a class="postlink" href="http://www.aspnetzero.com/Documents/Developing-Step-By-Step#extending-the-application-adding-phone-numbers">http://www.aspnetzero.com/Documents/Dev ... ne-numbers</a>).

    Since this is EntityFramework stuff, I also suggest you to check some documentation on EF Code-First and Migrations.

    Thanks.