public async Task <IActionResult> PutGama_Producto(string id, Gama_Producto gama_Producto) { if (id != gama_Producto.Gama) { return(BadRequest()); } _context.Entry(gama_Producto).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Gama_ProductoExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Gama_Producto> > PostGama_Producto(Gama_Producto gama_Producto) { _context.gama_Producto.Add(gama_Producto); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (Gama_ProductoExists(gama_Producto.Gama)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetGama_Producto", new { id = gama_Producto.Gama }, gama_Producto)); }