public async Task <IActionResult> PutMstProvince([FromRoute] int id, [FromBody] MstProvince mstProvince) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != mstProvince.ProvinceId) { return(BadRequest()); } _context.Entry(mstProvince).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstProvinceExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostMstProvince([FromBody] MstProvince mstProvince) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.MstProvince.Add(mstProvince); await _context.SaveChangesAsync(); return(CreatedAtAction("GetMstProvince", new { id = mstProvince.ProvinceId }, mstProvince)); }