-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to determine current tenant in the distributedEventBus #4508
Comments
The entity's TenantId may be different from the current TenantId. @hikalkan What do you think? |
|
thanks 2、Volo.Abp.Domain.Entities.Events.Distributed.EntityEto, as a general Eto, it has extensible Properties. If If your entity is multi-tenant. can add to this in the framework public object Map(object entityObj)
{
......
var etoMappingItem = Options.EtoMappings.GetOrDefault(entityType);
if (etoMappingItem == null)
{
var keys = entity.GetKeys().JoinAsString(",");
var eto = new EntityEto(entityType.FullName, keys);
// add this
if (entityObj is IMultiTenant multitenantEntity)
{
eto.Properties.Add("tenantid",multitenantEntity.TenantId);
}
return eto;
}
....
} |
It will be a big change. I always inject the |
1 was done with #4433 |
Does it mean that If MyEto class implements |
Yes, it means that. |
@maliming can you work on that in this milestone
Also consider this scenario:
|
.UseMiddleware<MultiTenancyMiddleware>
. So the DbContext uses the current host ,, Such as BlogUserSynchronizer in the Volo.Blogging module, it can only handle the host,
If you need to handle tenant,do we need to add
_currentTenant.Change(**)
,like thisThe text was updated successfully, but these errors were encountered: