Prerequisites
Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.
- What is your product version? latest
- What is your product type (Angular or MVC)? MVC
- What is product framework type (.net framework or .net core)? .net core
If issue related with ABP Framework
- What is ABP Framework version? 10.1.0
If issue is about UI
- Which theme are you using?
- What are the theme settings?
BackgroundJob - using IRepository<entity, int> for retrieval and writing changes The issue is when triggering a BackgroundJob and using IRepository<entity, int> injected, the calls to the repository for the respective repo fails to find the entity, exception notes no entity exists, however the entity is in the database. Can you think of why this is happening?
BackgroundJob - using AppServices injected Further when injecting AppServices and calling the retrieval methods, the Authorize permissions restricts use for the Background job, how do we work around this?
BackgroundJob - making Async calls How can this be done, do I have to call methods synchronously?
1 Answer(s)
-
0
Hi @Finfind
In background job context, TenantId will be NULL and if your entity is IMayHaveTenant or IMustHaveTenant, then your query will only bring entities with TenantId=NULL. If you are trying to retrieve and entity with a specific TenantId, see https://aspnetboilerplate.com/Pages/Documents/Multi-Tenancy#switching-between-host-and-tenants to switch to a specific Tenant and execute query in that using statement.