public async Task <IActionResult> PutEoperatingPeriod(short id, EoperatingPeriod eoperatingPeriod) { if (id != eoperatingPeriod.EoperatingPeriodId) { return(BadRequest()); } _context.Entry(eoperatingPeriod).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EoperatingPeriodExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <EoperatingPeriod> > PostEoperatingPeriod(EoperatingPeriod eoperatingPeriod) { _context.EoperatingPeriod.Add(eoperatingPeriod); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (EoperatingPeriodExists(eoperatingPeriod.EoperatingPeriodId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetEoperatingPeriod", new { id = eoperatingPeriod.EoperatingPeriodId }, eoperatingPeriod)); }