public async Task <IActionResult> PutGprice(int id, Gprice gprice) { if (id != gprice.Id) { return(BadRequest()); } _context.Entry(gprice).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GpriceExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Gprice> > PostGprice(Gprice gprice) { _context.Gprices.Add(gprice); await _context.SaveChangesAsync(); return(CreatedAtAction("GetGprice", new { id = gprice.Id }, gprice)); }