public async Task <IActionResult> PutBFormula([FromRoute] int id, [FromBody] BFormula bFormula) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != bFormula.Id) { return(BadRequest()); } _context.Entry(bFormula).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BFormulaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostBFormula([FromBody] BFormula bFormula) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.BFormula.Add(bFormula); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBFormula", new { id = bFormula.Id }, bFormula)); }