public async Task <IActionResult> PostPBonusTransactionStatusData([FromBody] PBonusTransactionStatusData pBonusTransactionStatusData) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.BonusTransactionStatusData.Add(pBonusTransactionStatusData); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPBonusTransactionStatusData", new { id = pBonusTransactionStatusData.Id }, pBonusTransactionStatusData)); }
public async Task <IActionResult> PutPBonusTransactionStatusData([FromRoute] int id, [FromBody] PBonusTransactionStatusData pBonusTransactionStatusData) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != pBonusTransactionStatusData.Id) { return(BadRequest()); } _context.Entry(pBonusTransactionStatusData).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PBonusTransactionStatusDataExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }