public async Task <IActionResult> PutMstVolumeType([FromRoute] int id, [FromBody] MstVolumeType mstVolumeType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mstVolumeType.VolumeTypeId) { return(BadRequest()); } _context.Entry(mstVolumeType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstVolumeTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostMstVolumeType([FromBody] MstVolumeType mstVolumeType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MstVolumeType.Add(mstVolumeType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMstVolumeType", new { id = mstVolumeType.VolumeTypeId }, mstVolumeType)); }