Base solution for your next web application
Open Closed

Use separate identification for each module #5049


User avatar
0
hitaspdotnet created

Hi, I'm trying to build a multi-service program. If your service user's has different entity property and roles in each service:

  1. How can you manage authorizations with multiple tenants?
  2. How can you store their entity in DB out of AbpUsers?

Example: We have two services named Commerce and LMS(Learning Management System) , Users naming Customer for Commerce service and Student for LMS. So their have own properties like Shopping cart items, addresses for customers or Courses, Tests for students.

What is the best way to implement this scenario? :!: :?: :? Thank you for any kind of help. ;) :(


4 Answer(s)
  • User Avatar
    0
    alper created
    Support Team

    You can use Table-Per-Hierarchy inheritance for AbpUser. Implement IHaveTest for both entities.

    class Customer : AbpUser, IHaveTest {}
    class Student : AbpUser, IHaveTest {}
    

    <a class="postlink" href="https://weblogs.asp.net/manavi/inheritance-mapping-strategies-with-entity-framework-code-first-ctp5-part-1-table-per-hierarchy-tph">https://weblogs.asp.net/manavi/inherita ... rarchy-tph</a>

  • User Avatar
    0
    hitaspdotnet created

    <cite>alper: </cite> You can use Table-Per-Hierarchy inheritance for AbpUser. Implement IHaveTest for both entities.

    class Customer : AbpUser, IHaveTest {}
    class Student : AbpUser, IHaveTest {}
    

    <a class="postlink" href="https://weblogs.asp.net/manavi/inheritance-mapping-strategies-with-entity-framework-code-first-ctp5-part-1-table-per-hierarchy-tph">https://weblogs.asp.net/manavi/inherita ... rarchy-tph</a>

    Thank you Mr. Alper for this reply and helpful article. What's IHaveTest and why I need to implement that?

  • User Avatar
    0
    alper created
    Support Team

    Actually you don't need to implement IHaveTest. I misunderstood your Tests for students. Ignore it.

  • User Avatar
    0
    hitaspdotnet created

    <cite>alper: </cite> Actually you don't need to implement IHaveTest. I misunderstood your Tests for students. Ignore it.

    My English is bad, very bad, I know :D Sir Thank you again