private AuditLog AddLog(AuditLog.LogType logType, DbEntityEntry dbEntry, string userName, DateTime eventTime, string tableName, string propName) { return(new AuditLog { UserName = userName, EventDate = eventTime, EventType = (int)logType, ColumnName = propName, TableName = tableName, OriginalValue = GetProperty(dbEntry, "OriginalValues", propName) == null ? "" : GetProperty(dbEntry, "OriginalValues", propName).ToString(), NewValue = GetProperty(dbEntry, "CurrentValues", propName) == null ? "" : GetProperty(dbEntry, "CurrentValues", propName).ToString(), Entity = dbEntry }); }
private AuditLog AddLog(AuditLog.LogType logType, AuditLog log) { return(AddLog(logType, log.Entity, log.UserName, log.EventDate, log.TableName, log.ColumnName)); }