public async Task <ActionResult <TblBacLuong> > PostTblBacLuong(TblBacLuong tblBacLuong) { _context.TblBacLuongs.Add(tblBacLuong); await _context.SaveChangesAsync(); return(CreatedAtAction("GetTblBacLuong", new { id = tblBacLuong.MaBac }, tblBacLuong)); }
public async Task <IActionResult> PutTblBacLuong(long id, TblBacLuong tblBacLuong) { if (id != tblBacLuong.MaBac) { return(BadRequest()); } _context.Entry(tblBacLuong).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TblBacLuongExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }