protected virtual void ApplyAbpConceptsForDeletedEntity(DbEntityEntry entry, long?userId, EntityChangeReport changeReport) { //设置实体的状态 entry.State = EntityState.Modified; EntityAuditingHelper.SetDeletionAuditProperties(entry.Entity, userId); changeReport.ChangedEntities.Add(new EntityChangeEntry(entry.Entity, EntityChangeType.Deleted)); }
protected virtual void ApplyAbpConceptsForDeletedEntity(EntityEntry entry) { if (entry.Entity is ISoftDelete) { entry.State = EntityState.Modified; EntityAuditingHelper.SetDeletionAuditProperties(entry.Entity, EasyNetSession.UserId); } }
protected virtual void SetDeletionAuditProperties(object entityAsObj, long?userId) { EntityAuditingHelper.SetDeletionAuditProperties( MultiTenancyConfig, entityAsObj, AbpSession.TenantId, userId, CurrentUnitOfWorkProvider?.Current?.AuditFieldConfiguration ); }
protected virtual void ApplyAbpConceptsForModifiedEntity(DbEntityEntry entry, long?userId, EntityChangeReport changeReport) { EntityAuditingHelper.SetModificationAuditProperties(entry.Entity, userId); if (entry.Entity is IHasDelete && entry.Entity.As <IHasDelete>().IsDel) { EntityAuditingHelper.SetDeletionAuditProperties(entry.Entity, userId); changeReport.ChangedEntities.Add(new EntityChangeEntry(entry.Entity, EntityChangeType.Deleted)); } else { changeReport.ChangedEntities.Add(new EntityChangeEntry(entry.Entity, EntityChangeType.Updated)); } }
protected virtual void Apply4DeletedEntity(DbEntityEntry entry, long?userId) { EntityAuditingHelper.SetDeletionAuditProperties(entry.Entity, userId); }
protected virtual void SetDeletionAuditProperties(object entityAsObj, long?userId) { EntityAuditingHelper.SetDeletionAuditProperties(entityAsObj, userId); }