public async Task UpdateADMasterDesignation(ADMasterDesignation objADMasterDesignation) { try { _Context.Entry(objADMasterDesignation).State = EntityState.Modified; await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task InsertADMasterDesignation(ADMasterDesignation objADMasterDesignation) { try { _Context.ADMasterDesignations.Add(objADMasterDesignation); await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task <ActionResult <MasterDesignationResult> > PutADMasterDesignation(long id, ADMasterDesignation objADMasterDesignation) { if (id != objADMasterDesignation.MasterDesignationId) { return(BadRequest()); } try { await _IMasterDesignationInterface.UpdateADMasterDesignation(objADMasterDesignation); return(_IMasterDesignationInterface.GetADMasterDesignationByID(id)); } catch (DbUpdateConcurrencyException) { if (!_IMasterDesignationInterface.ADMasterDesignationExists(id)) { return(NotFound()); } else { throw; } } catch (Exception ex) { throw new Exception(ex.Message); } return(NoContent()); }
public async Task <ActionResult <MasterDesignationResult> > PostADMasterDesignation(ADMasterDesignation objADMasterDesignation) { try { await _IMasterDesignationInterface.InsertADMasterDesignation(objADMasterDesignation); return(CreatedAtAction("GetADMasterDesignation", new { id = objADMasterDesignation.MasterDesignationId }, objADMasterDesignation)); } catch (Exception ex) { throw new Exception(ex.Message); } }