public async Task <IActionResult> PutBNgType([FromRoute] int id, [FromBody] BNgType bNgType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != bNgType.TypeId) { return(BadRequest()); } _context.Entry(bNgType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BNgTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostBNgType([FromBody] BNgType bNgType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.BNgType.Add(bNgType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBNgType", new { id = bNgType.TypeId }, bNgType)); }