baratgabor / MyWarehouse

Clean Architecture and Domain Driven Design sample project based on C# 10 / .NET 6 / ASP.NET Core 6 / EF Core 6 & Angular 11 with Bootstrap.
MIT License
243 stars 69 forks source link

One to many on ApplicationUser (TenantLike) #33

Open pointlevel opened 3 years ago

pointlevel commented 3 years ago

Hi,

Thanks for this faboulus project, looks very promising and i really like the architecture. I was wondering how to add a simple multitenant kind of approach to this project. I would like to have an entity named "Company" that holds the ApplicationUsers in a one-to-many relationship. One company can have many users. And every company should have their own products etc... Im thinking of a BaseEntity with a public string CompanyId for every company-specific entity.

Though is the ApplicationUser defined in the Infrastructure-project which makes troubles if i want to add a IList of ApplicationUsers to the company-entity placed in the Domain-project because the Domain is not supposed to have references to other project, like Infrastructure.

Any suggestions or good practice about it?

Thanks!