public void SaveError(Exception ex) { using (db = new PMSContext()) { error = new ErrorLog { CreatedOn = DateTime.Now, HelpLink = ex.HelpLink, HResult = ex.HResult, Message = ex.Message, Source = ex.Source, StackTrace = ex.StackTrace }; db.ErrorLog.Add(error); db.SaveChanges(); } }
public bool Delete(Guid id) { try { using (db = new PMSContext()) { db.PMSuser.Where(x => x.Id == id).FirstOrDefault().IsDeleted = true; db.SaveChanges(); return(true); } } catch (Exception ex) { errorService.SaveError(ex); return(false); } }