public async Task UpdateADMasterSalutation(ADMasterSalutation objADMasterSalutation) { try { _Context.Entry(objADMasterSalutation).State = EntityState.Modified; await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task InsertADMasterSalutation(ADMasterSalutation objADMasterSalutation) { try { _Context.ADMasterSalutations.Add(objADMasterSalutation); await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task <ActionResult <MasterSalutationResult> > PutADMasterSalutation(long id, ADMasterSalutation objADMasterSalutation) { if (id != objADMasterSalutation.MasterSalutationId) { return(BadRequest()); } try { await _IMasterSalutationInterface.UpdateADMasterSalutation(objADMasterSalutation); return(_IMasterSalutationInterface.GetADMasterSalutationByID(id)); } catch (DbUpdateConcurrencyException) { if (!_IMasterSalutationInterface.ADMasterSalutationExists(id)) { return(NotFound()); } else { throw; } } catch (Exception ex) { throw new Exception(ex.Message); } return(NoContent()); }
public async Task <ActionResult <MasterSalutationResult> > PostADMasterSalutation(ADMasterSalutation objADMasterSalutation) { try { await _IMasterSalutationInterface.InsertADMasterSalutation(objADMasterSalutation); return(CreatedAtAction("GetADMasterSalutation", new { id = objADMasterSalutation.MasterSalutationId }, objADMasterSalutation)); } catch (Exception ex) { throw new Exception(ex.Message); } }