public async Task InsertADMasterRegistrationType(ADMasterRegistrationType objADMasterRegistrationType) { try { _Context.ADMasterRegistrationType.Add(objADMasterRegistrationType); await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task UpdateADMasterRegistrationType(ADMasterRegistrationType objADMasterRegistrationType) { try { _Context.Entry(objADMasterRegistrationType).State = Microsoft.EntityFrameworkCore.EntityState.Modified; await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task DeleteADMasterRegistrationType(long MasterRegistrationTypeId) { try { ADMasterRegistrationType objADMasterRegistrationType = _Context.ADMasterRegistrationType.Find(MasterRegistrationTypeId); _Context.ADMasterRegistrationType.Remove(objADMasterRegistrationType); await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task <ActionResult <MasterRegistrationTypeResult> > PutADMasterRegistrationType(long id, ADMasterRegistrationType objADMasterRegistrationType) { if (id != objADMasterRegistrationType.MasterRegistrationTypeId) { return(BadRequest()); } try { await _IMasterRegistrationTypeInterface.UpdateADMasterRegistrationType(objADMasterRegistrationType); return(_IMasterRegistrationTypeInterface.GetADMasterRegistrationTypeByID(id)); } catch (DbUpdateConcurrencyException) { if (!_IMasterRegistrationTypeInterface.ADMasterRegistrationTypeExists(id)) { return(NotFound()); } else { throw; } } catch (Exception ex) { throw new Exception(ex.Message); } return(NoContent()); }
public async Task <ActionResult <MasterRegistrationTypeResult> > PostADMasterRegistrationType(ADMasterRegistrationType objADMasterRegistrationType) { try { await _IMasterRegistrationTypeInterface.InsertADMasterRegistrationType(objADMasterRegistrationType); return(CreatedAtAction("GetADMasterRegistrationType", new { id = objADMasterRegistrationType.MasterRegistrationTypeId }, objADMasterRegistrationType)); } catch (Exception ex) { throw new Exception(ex.Message); } }