コード例 #1
0
 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));
 }
コード例 #2
0
 protected virtual void ApplyAbpConceptsForDeletedEntity(EntityEntry entry)
 {
     if (entry.Entity is ISoftDelete)
     {
         entry.State = EntityState.Modified;
         EntityAuditingHelper.SetDeletionAuditProperties(entry.Entity, EasyNetSession.UserId);
     }
 }
コード例 #3
0
 protected virtual void SetDeletionAuditProperties(object entityAsObj, long?userId)
 {
     EntityAuditingHelper.SetDeletionAuditProperties(
         MultiTenancyConfig,
         entityAsObj,
         AbpSession.TenantId,
         userId,
         CurrentUnitOfWorkProvider?.Current?.AuditFieldConfiguration
         );
 }
コード例 #4
0
 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));
     }
 }
コード例 #5
0
 protected virtual void Apply4DeletedEntity(DbEntityEntry entry, long?userId)
 {
     EntityAuditingHelper.SetDeletionAuditProperties(entry.Entity, userId);
 }
コード例 #6
0
 protected virtual void SetDeletionAuditProperties(object entityAsObj, long?userId)
 {
     EntityAuditingHelper.SetDeletionAuditProperties(entityAsObj, userId);
 }