public async Task <IActionResult> PutEholidays(long id, Eholidays eholidays) { if (id != eholidays.EholidaysId) { return(BadRequest()); } _context.Entry(eholidays).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EholidaysExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Eholidays> > PostEholidays(Eholidays eholidays) { _context.Eholidays.Add(eholidays); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (EholidaysExists(eholidays.EholidaysId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetEholidays", new { id = eholidays.EholidaysId }, eholidays)); }