Ejemplo n.º 1
0
        public AuditEntryFactoryArgs(Audit audit, EntityEntry entityEntry, AuditEntryState auditEntryState)
#endif
        {
            Audit           = audit;
            AuditEntryState = auditEntryState;

#if EF5 || EF6
            ObjectStateEntry = objectStateEntry;
#elif EFCORE
            EntityEntry = entityEntry;
#endif
        }
        public static void AuditEntityModified(Audit audit, EntityEntry objectStateEntry, AuditEntryState state)
#endif
        {
            var entry = audit.Configuration.AuditEntryFactory != null?
                        audit.Configuration.AuditEntryFactory(new AuditEntryFactoryArgs(audit, objectStateEntry, state)) :
                            new AuditEntry();

            entry.Build(audit, objectStateEntry);
            entry.State = state;

#if EF5 || EF6
            AuditEntityModified(audit, entry, objectStateEntry, objectStateEntry.OriginalValues, objectStateEntry.CurrentValues);
#elif EFCORE
            AuditEntityModified(audit, entry, objectStateEntry);
#endif
            audit.Entries.Add(entry);
        }
        /// <summary>Audit entity modified.</summary>
        /// <param name="audit">The audit to use to add changes made to the context.</param>
        /// <param name="objectStateEntry">The object state entry.</param>
#if EF5 || EF6
        public static void AuditEntityModified(Audit audit, ObjectStateEntry objectStateEntry, AuditEntryState state)
Ejemplo n.º 4
0
        public static void AuditEntityModified(Audit audit, EntityEntry objectStateEntry, AuditEntryState state)
#endif
        {
            var entry = audit.Configuration.AuditEntryFactory != null?
                        audit.Configuration.AuditEntryFactory(new AuditEntryFactoryArgs(audit, objectStateEntry, state)) :
                            new AuditEntry();

            entry.Build(audit, objectStateEntry);
            entry.State = state;

#if EF5 || EF6
            AuditEntityModified(audit, entry, objectStateEntry, objectStateEntry.OriginalValues, objectStateEntry.CurrentValues);
#elif EFCORE
            AuditEntityModified(audit, entry, objectStateEntry);
#endif
            if (audit.Configuration.IgnoreEntityUnchanged)
            {
                if (entry.Properties != null && entry.Properties.Count > 0)
                {
                    audit.Entries.Add(entry);
                }
            }
            else
            {
                audit.Entries.Add(entry);
            }
        }
        public static void AuditEntityModified(Audit audit, EntityEntry objectStateEntry, AuditEntryState state)
#endif
        {
            var entry = new AuditEntry(audit, objectStateEntry)
            {
                State = state
            };

#if EF5 || EF6
            AuditEntityModified(audit, entry, objectStateEntry, objectStateEntry.OriginalValues, objectStateEntry.CurrentValues);
#elif EFCORE
            AuditEntityModified(audit, entry, objectStateEntry);
#endif
            audit.Entries.Add(entry);
        }
Ejemplo n.º 6
0
 public AuditEntryFactoryArgs(Audit audit, ObjectStateEntry objectStateEntry, AuditEntryState auditEntryState)