public static void Log(string action, string desc, string relatedEntity) { using (var db = new IRContextDataContext()) { AuditTrail audit = new AuditTrail(); audit.User = HttpContext.Current.User.Identity.Name; audit.Action = action; audit.Description = desc; audit.AssociatedId = relatedEntity; audit.ActionDate = DateTime.Now; db.AuditTrails.InsertOnSubmit(audit); db.SubmitChanges(); } }
partial void DeleteAuditTrail(AuditTrail instance);
partial void UpdateAuditTrail(AuditTrail instance);
partial void InsertAuditTrail(AuditTrail instance);