public async Task <ActionResult <PrestamoView> > PostPrestamoView(PrestamoView prestamoView) { _context.PrestamoView.Add(prestamoView); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPrestamoView", new { id = prestamoView.IdPrestamo }, prestamoView)); }
public async Task <IActionResult> PutPrestamoView(int id, PrestamoView prestamoView) { if (id != prestamoView.IdPrestamo) { return(BadRequest()); } _context.Entry(prestamoView).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PrestamoViewExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }