public async Task <ActionResult <NumbersHoursDay> > PostNumbersHoursDay(NumbersHoursDay numbersHoursDay) { _context.NumbersHoursDays.Add(numbersHoursDay); await _context.SaveChangesAsync(); return(CreatedAtAction("GetNumbersHoursDay", new { id = numbersHoursDay.Id }, numbersHoursDay)); }
public async Task <IActionResult> PutNumbersHoursDay(int id, NumbersHoursDay numbersHoursDay) { if (id != numbersHoursDay.Id) { return(BadRequest()); } _context.Entry(numbersHoursDay).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!NumbersHoursDayExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }