public async Task <ActionResult <Gioday> > PostGioday(Gioday gioday) { _context.Gioday.Add(gioday); await _context.SaveChangesAsync(); return(CreatedAtAction("GetGioday", new { id = gioday.MaGd }, gioday)); }
public async Task <IActionResult> PutGioday(int id, Gioday gioday) { if (id != gioday.MaGd) { return(BadRequest()); } _context.Entry(gioday).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GiodayExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }