0
Siyeza created
Hi,
What is the recommended way for deternining the current Tenant for domain service operations that operate on tenant specific data? Should I rely on AbpSession being populated with current TenantId or should I explicitly specify the TenantId as a parameter in the domain service requests, and use CurrentUnitOfWork.SetTenantId()?
Thanks
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
2 Answer(s)
-
0
hi
You can use the following method to get TenantId
protected virtual int? GetCurrentTenantIdOrNull() { if (CurrentUnitOfWorkProvider?.Current != null) { return CurrentUnitOfWorkProvider.Current.GetTenantId(); } return AbpSession.TenantId; }Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Thank you
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)