public void AuditAdditions(IEnumerable <EntityEntry> addedEntries)
 {
     // Get all Added entities
     foreach (EntityEntry ent in addedEntries)
     {
         using (var auditer = new LogAuditor(ent))
         {
             AuditLog record = auditer.CreateLogRecord(EventType.Added, _context);
             if (record != null)
             {
                 var arg = new AuditLogGeneratedEventArgs(record, ent.Entity);
                 RaiseOnAuditLogGenerated(this, arg);
                 if (!arg.SkipSavingLog)
                 {
                     _context.Add(record);
                 }
             }
         }
     }
 }
        public void AuditChanges()
        {
            // Get all Deleted/Modified entities (not Unmodified or Detached or Added)  EntityState.Deleted ||
            foreach (
                EntityEntry ent in _context.ChangeTracker.Entries()
                .Where(p => p.State == EntityState.Modified))
            {
                using (var auditer = new LogAuditor(ent))
                {
                    AuditLog record = auditer.CreateLogRecord(EventType.Modified, _context);

                    if (record != null)
                    {
                        var arg = new AuditLogGeneratedEventArgs(record, ent.Entity);
                        RaiseOnAuditLogGenerated(this, arg);
                        if (!arg.SkipSavingLog)
                        {
                            _context.Add(record);
                            return;
                        }
                    }
                }
            }
        }