public async Task <IActionResult> PutMstPaymentType([FromRoute] int id, [FromBody] MstPaymentType mstPaymentType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mstPaymentType.PaymentTypeId) { return(BadRequest()); } _context.Entry(mstPaymentType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstPaymentTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostMstPaymentType([FromBody] MstPaymentType mstPaymentType) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MstPaymentType.Add(mstPaymentType); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMstPaymentType", new { id = mstPaymentType.PaymentTypeId }, mstPaymentType)); }