Base solution for your next web application

Activities of "fengger"

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&lt;ICreationAudited&gt;().Entity.CreatorUserId = AbpSession.UserId;
        }
       **if (entry.Entity is IMayHaveTenant)
        {
            entry.Cast&lt;IMayHaveTenant&gt;().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&lt;IMustHaveTenant&gt;().Entity.TenantId = AbpSession.TenantId.Value;
        }
        if (entry.Entity is IPassivable)
        {
            entry.Cast&lt;IPassivable&gt;().Entity.IsActive = true;
        }**
    }
Showing 1 to 1 of 1 entries