Ejemplo n.º 1
0
        private void ApplyAdmConcepts()
        {
            var session = IocManager.Current.Resolve <IAdmSession>();

            foreach (var entry in ChangeTracker.Entries().ToList())
            {
                switch (entry.State)
                {
                case EntityState.Added:
                    CheckAndSetId(entry);
                    AdmEntityAuditingHelper.SetCreationAuditProperties(entry.Entity, session);
                    break;

                case EntityState.Modified:
                    CheckAndSetId(entry);
                    AdmEntityAuditingHelper.SetModificationAuditProperties(entry.Entity, session);
                    break;

                case EntityState.Deleted:
                    CancelDeletionForSoftDelete(entry);
                    AdmEntityAuditingHelper.SetDeletionAuditProperties(entry.Entity, session);
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        private void ApplyAdmConcepts()
        {
            foreach (var entry in ChangeTracker.Entries().ToList())
            {
                switch (entry.State)
                {
                case EntityState.Added:
                    AdmEntityAuditingHelper.SetCreationAuditProperties(entry.Entity);
                    break;

                case EntityState.Modified:
                    AdmEntityAuditingHelper.SetModificationAuditProperties(entry.Entity);
                    break;
                    //case EntityState.Deleted:
                    //    SetDeletionAuditProperties(entry.Entity);
                    //break;
                }
            }
        }