increase the default field(TenantId,IsActive) protected virtual void SetCreationAuditProperties(DbEntityEntry entry) { if (entry.Entity is IHasCreationTime) { entry.Cast<IHasCreationTime>().Entity.CreationTime = Clock.Now; }
if (entry.Entity is ICreationAudited)
{
entry.Cast<ICreationAudited>().Entity.CreatorUserId = AbpSession.UserId;
}
**if (entry.Entity is IMayHaveTenant)
{
entry.Cast<IMayHaveTenant>().Entity.TenantId = AbpSession.TenantId;
}
if (entry.Entity is IMustHaveTenant)
{
if (AbpSession.TenantId == null)
throw new DbEntityValidationException("Configuration.MultiTenancy.IsEnabled is true,but TenantId is null");
entry.Cast<IMustHaveTenant>().Entity.TenantId = AbpSession.TenantId.Value;
}
if (entry.Entity is IPassivable)
{
entry.Cast<IPassivable>().Entity.IsActive = true;
}**
}