public async Task <IActionResult> PutMucDoUuTien([FromRoute] int id, [FromBody] MucDoUuTien mucdouutien) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mucdouutien.MucDoUuTienId) { return(BadRequest()); } _context.Entry(mucdouutien).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MucDoUuTienExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostMucDoUuTien([FromBody] MucDoUuTien mucdouutien) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MucDoUuTiens.Add(mucdouutien); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMucDoUuTien", new { id = mucdouutien.MucDoUuTienId }, mucdouutien)); }