public async Task <ActionResult <CpoFeed> > PostCpoFeed(CpoFeed cpoFeed) { _context.CpoFeed.Add(cpoFeed); await _context.SaveChangesAsync(); return(CreatedAtAction("GetCpoFeed", new { id = cpoFeed.Idfeed }, cpoFeed)); }
public async Task <IActionResult> PutCpoFeed(int id, CpoFeed cpoFeed) { if (id != cpoFeed.Idfeed) { return(BadRequest()); } _context.Entry(cpoFeed).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CpoFeedExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }