public async Task <IActionResult> PutGrelistview([FromRoute] int id, [FromBody] Grelistview grelistview) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != grelistview.Id) { return(BadRequest()); } _context.Entry(grelistview).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GrelistviewExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostGrelistview([FromBody] Grelistview grelistview) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.Grelistview.Add(grelistview); await _context.SaveChangesAsync(); return(CreatedAtAction("GetGrelistview", new { id = grelistview.Id }, grelistview)); }