public async Task <IActionResult> PutBProcessType([FromRoute] int id, [FromBody] BProcessType bProcessType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != bProcessType.TypeId) { return(BadRequest()); } _context.Entry(bProcessType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BProcessTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostBProcessType([FromBody] BProcessType bProcessType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.BProcessType.Add(bProcessType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBProcessType", new { id = bProcessType.TypeId }, bProcessType)); }