public async Task <IActionResult> PutEblocks(long id, Eblocks eblocks) { if (id != eblocks.EblocksId) { return(BadRequest()); } _context.Entry(eblocks).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EblocksExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Eblocks> > PostEblocks(Eblocks eblocks) { _context.Eblocks.Add(eblocks); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (EblocksExists(eblocks.EblocksId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetEblocks", new { id = eblocks.EblocksId }, eblocks)); }