public async Task <ActionResult <MucDoHaiLong> > PostMucDoHaiLong(MucDoHaiLong mucDoHaiLong) { _context.MucDoHaiLongs.Add(mucDoHaiLong); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMucDoHaiLong", new { id = mucDoHaiLong.Id }, mucDoHaiLong)); }
public async Task <IActionResult> PutMucDoHaiLong(int id, MucDoHaiLong mucDoHaiLong) { if (id != mucDoHaiLong.Id) { return(BadRequest()); } _context.Entry(mucDoHaiLong).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MucDoHaiLongExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }