public async Task <IActionResult> PutPBonusTransactions([FromRoute] int id, [FromBody] PBonusTransactions pBonusTransactions) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != pBonusTransactions.Id) { return(BadRequest()); } _context.Entry(pBonusTransactions).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PBonusTransactionsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostPBonusTransactions([FromBody] PBonusTransactions pBonusTransactions) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.BonusTransactions.Add(pBonusTransactions); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPBonusTransactions", new { id = pBonusTransactions.Id }, pBonusTransactions)); }