public async Task <IActionResult> PutClienteRanking([FromRoute] int id, [FromBody] ClienteRanking clienteRanking) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != clienteRanking.Id) { return(BadRequest()); } _context.Entry(clienteRanking).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClienteRankingExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostClienteRanking([FromBody] ClienteRanking clienteRanking) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.ClienteRanking.Add(clienteRanking); await _context.SaveChangesAsync(); return(CreatedAtAction("GetClienteRanking", new { id = clienteRanking.Id }, clienteRanking)); }