0
khalid created
ABP Framework version: v3.2.0 UI type: Angular Tiered (MVC) or Identity Server Seperated (Angular): Identity Server Seperated (Angular) Exception message and stack trace: Steps to reproduce the issue:
I have same issue like this How to share an entity that is managed by the host but is accessible by tenants
public class Book: FullAuditedAggregateRoot<Guid>, IMultiTenant
{
public virtual Guid? TenantId { get; set; } }
public string BookName { get; set; }
}
How can share an entity that is created by the host to all tenants?
For example a tenant user should be able to see the list of books which is created by himself and by host. do I need to add Feature check? if so how?
2 Answer(s)
-
0
HI,
This has nothing to do with Feature check, You need to query twice when you are querying the book list. example:
public async Task<List<BookDto>> GetBooks() { var result = new List<BookDto>(); // get the host's books using(CurrentTenant.Change(null)) { result.Add(await BookRepository.ToListAsync()); } // get the tenant user's books result.Add(await BookRepository.ToListAsync()); }
-
0
I got it thanks liangshiwei