public async Task UpdateADMasterConfiguration(ADMasterConfiguration objADMasterConfiguration) { try { _Context.Entry(objADMasterConfiguration).State = Microsoft.EntityFrameworkCore.EntityState.Modified; await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task InsertADMasterConfiguration(ADMasterConfiguration objADMasterConfiguration) { try { _Context.ADMasterConfigurations.Add(objADMasterConfiguration); await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task DeleteADMasterConfiguration(long MasterConfigurationId) { try { ADMasterConfiguration objADMasterConfiguration = _Context.ADMasterConfigurations.Find(MasterConfigurationId); _Context.ADMasterConfigurations.Remove(objADMasterConfiguration); await _Context.SaveChangesAsync(); } catch (Exception ex) { throw new Exception(ex.Message); } }
public async Task <ActionResult <MasterConfigurationResult> > PutADMasterConfiguration(long id, ADMasterConfiguration objADMasterConfiguration) { if (id != objADMasterConfiguration.MasterConfigurationId) { return(BadRequest()); } try { await _IMasterConfigurationInterface.UpdateADMasterConfiguration(objADMasterConfiguration); return(_IMasterConfigurationInterface.GetADMasterConfigurationByID(id)); } catch (DbUpdateConcurrencyException) { if (!_IMasterConfigurationInterface.ADMasterConfigurationExists(id)) { return(NotFound()); } else { throw; } } catch (Exception ex) { throw new Exception(ex.Message); } return(NoContent()); }
public async Task <ActionResult <MasterConfigurationResult> > PostADMasterConfiguration(ADMasterConfiguration objADMasterConfiguration) { try { await _IMasterConfigurationInterface.InsertADMasterConfiguration(objADMasterConfiguration); return(CreatedAtAction("GetADMasterConfiguration", new { id = objADMasterConfiguration.MasterConfigurationId }, objADMasterConfiguration)); } catch (Exception ex) { throw new Exception(ex.Message); } }