public async Task <IActionResult> PutEocpPropOther(short id, EocpPropOther eocpPropOther) { if (id != eocpPropOther.EocpPropOtherId) { return(BadRequest()); } _context.Entry(eocpPropOther).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EocpPropOtherExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <EocpPropOther> > PostEocpPropOther(EocpPropOther eocpPropOther) { _context.EocpPropOther.Add(eocpPropOther); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (EocpPropOtherExists(eocpPropOther.EocpPropOtherId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetEocpPropOther", new { id = eocpPropOther.EocpPropOtherId }, eocpPropOther)); }