public async Task <IActionResult> PutAddRuleModel(ScrewCompressorConfigurationModel addRuleModel) { int id = addRuleModel.AddRuleId; if (id != addRuleModel.AddRuleId) { return(BadRequest()); } _context.Entry(addRuleModel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AddRuleModelExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <ScrewCompressorConfigurationModel> > PostAddRuleModel(ScrewCompressorConfigurationModel addRuleModel) { try { _context.AddRuleModels.Add(addRuleModel); await _context.SaveChangesAsync(); return(CreatedAtAction("GetAddRuleModel", new { id = addRuleModel.AddRuleId }, addRuleModel)); } catch (System.Exception exe) { return(BadRequest(exe.Message)); } }