public async Task InsertADMasterErrorLog(ADMasterErrorLog objADMasterErrorLog) { try { _Context.ADMasterErrorLogs.Add(objADMasterErrorLog); await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task UpdateADMasterErrorLog(ADMasterErrorLog objADMasterErrorLog) { try { _Context.Entry(objADMasterErrorLog).State = Microsoft.EntityFrameworkCore.EntityState.Modified; await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task DeleteADMasterErrorLog(long MasterErrorLogId) { try { ADMasterErrorLog objADMasterErrorLog = _Context.ADMasterErrorLogs.Find(MasterErrorLogId); _Context.ADMasterErrorLogs.Remove(objADMasterErrorLog); await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task <ActionResult <MasterErrorLogResult> > PostADMasterErrorLog(ADMasterErrorLog objADMasterErrorLog) { try { await _IMasterErrorLogInterface.InsertADMasterErrorLog(objADMasterErrorLog); return(CreatedAtAction("GetADMasterErrorLog", new { id = objADMasterErrorLog.MasterErrorLogId }, objADMasterErrorLog)); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task <ActionResult <MasterErrorLogResult> > PutADMasterErrorLog(long id, ADMasterErrorLog objADMasterErrorLog) { if (id != objADMasterErrorLog.MasterErrorLogId) { return(BadRequest()); } try { await _IMasterErrorLogInterface.UpdateADMasterErrorLog(objADMasterErrorLog); return(_IMasterErrorLogInterface.GetADMasterErrorLogByID(id)); } catch (DbUpdateConcurrencyException) { if (!_IMasterErrorLogInterface.ADMasterErrorLogExists(id)) { return(NotFound()); } else { throw; } } catch (Exception ex) { throw new Exception(ex.Message); } return(NoContent()); }