public async Task <Status> GetCaseStatusByIdAsync(int statusId) { try { return(CaseStatusMapper.Map(await _context.Casestatuses.FindAsync(statusId))); } catch (Exception e) { return(null); } }
public async Task <Status> GetCaseStatusByTextAsync(string text) { try { return(CaseStatusMapper.Map(_context.Casestatuses.FirstOrDefault(s => s.Statustext == text))); } catch (Exception e) { return(null); } }
public async Task <bool> AddCaseStatusAsync(Status caseStatus, bool save = true) { try { _context.Casestatuses.Add(CaseStatusMapper.Map(caseStatus)); if (save) { await _context.SaveChangesAsync(); } return(true); } catch (Exception e) { return(false); } }