Search code examples
abp-framework

Is there a way to create a CRUD as multi-tenancy in ABP.io?


I want to create a CRUD using the class CrudAppService<TEntity, TEntityDto, TKey> but my entity is a IMultiTenant. Is there a way it can automatically add this tenant id for me or do I have to overwrite the default CRUD?


Solution

  • At this line AbstractKeyCrudAppService.cs#L91

    CrudAppService tries to set TenantId from CurrentTenant. So, If you create a tenant and switch to it, TenantId will be set automatically.