Browse Source

Check entity has a tenant id value.

pull/1137/head
mehmetuken 7 years ago
parent
commit
1103ed2a26
  1. 7
      framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/CrudAppServiceBase.cs

7
framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/CrudAppServiceBase.cs

@ -154,9 +154,14 @@ namespace Volo.Abp.Application.Services
protected virtual void TryToSetTenantId(TEntity entity)
{
if (entity is IMultiTenant tenantEntity && tenantEntity.TenantId.HasValue)
{
return;
}
var tenantId = CurrentTenant.Id;
if (tenantId == null)
if (!tenantId.HasValue)
{
return;
}

Loading…
Cancel
Save