public async Task <ActionResult <Priscriptions> > PostPriscriptions(Priscriptions priscriptions) { _context.Priscriptions.Add(priscriptions); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPriscriptions", new { id = priscriptions.PriscriptionId }, priscriptions)); }
public async Task <IActionResult> PutPriscriptions(int id, Priscriptions priscriptions) { if (id != priscriptions.PriscriptionId) { return(BadRequest()); } _context.Entry(priscriptions).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PriscriptionsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }