public void Log(IEnumerable <DbEntityEntry <BaseModel> > entries) { foreach (DbEntityEntry <BaseModel> entry in entries) { switch (entry.State) { case EntityState.Added: case EntityState.Deleted: case EntityState.Modified: LoggableEntity entity = new LoggableEntity(entry); if (entity.Properties.Any()) { Log(entity); } break; } } }
public void Log(LoggableEntity entity) { Entities.Add(entity); }