public async Task <IActionResult> PutBillVotes([FromRoute] int id, [FromBody] BillVotes billVotes) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != billVotes.Id) { return(BadRequest()); } _context.Entry(billVotes).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BillVotesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostBillVotes([FromBody] BillVotes billVotes) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.BillVotes.Add(billVotes); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBillVotes", new { id = billVotes.Id }, billVotes)); }