public DbLog(DateTime execDate, ACTION_TARGET actionTarget, ACTION action, CHANGE_FIELD changeField, int execUserId, int targetId, string targetName, string targetStatusName, string targetScopeName) { ExecDate = execDate; ActionTarget = actionTarget; Action = action; ChangeField = changeField; ExecUserId = execUserId; TargetId = targetId; TargetName = targetName; TargetStatusName = targetStatusName; TargetScopeName = targetScopeName; }
public void Update(User source, T entity, CHANGE_FIELD field = CHANGE_FIELD.NONE) { _context.Set <T>().Update(entity); _context.SaveChanges(); if (source != null) { var log = new DbLog(); log.ExecUserId = source.Id; log.Action = ACTION.UPDATE; log.ChangeField = field; this.Logging(log, entity); } }