public async Task <IActionResult> PutBBom([FromRoute] int id, [FromBody] BBom bBom) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != bBom.BomId) { return(BadRequest()); } _context.Entry(bBom).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BBomExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostBBom([FromBody] BBom bBom) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.BBom.Add(bBom); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBBom", new { id = bBom.BomId }, bBom)); }