public async Task <ActionResult <Recepit> > PostRecepit(Recepit recepit) { _context.Recepits.Add(recepit); await _context.SaveChangesAsync(); return(CreatedAtAction("GetRecepit", new { id = recepit.Id }, recepit)); }
public async Task <IActionResult> PutRecepit(long id, Recepit recepit) { if (id != recepit.Id) { return(BadRequest()); } _context.Entry(recepit).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RecepitExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }