public static void Add(string action, string sysUser_Email, string actionDescription = "") { jashdownEntities db = new jashdownEntities(); var auditlog = db.AuditLog.Include(a => a.SysUser); AuditLog newAuditLog = new AuditLog(); newAuditLog.Action = action; newAuditLog.ActionDescription = actionDescription; newAuditLog.SysUser_Email = sysUser_Email; newAuditLog.ActionDateTime = DateTime.Now; db.AuditLog.Add(newAuditLog); db.SaveChanges(); db.Dispose(); }
protected override void Dispose(bool disposing) { db.Dispose(); base.Dispose(disposing); }