public async Task <IActionResult> CreateStateProvince([FromBody] Person.StateProvince value) { _db.Person_StateProvince.Add(value); await _db.SaveChangesAsync(); return(Ok(value)); }
public async Task <IActionResult> EditStateProvince(int stateProvinceID, [FromBody] Person.StateProvince value) { var existing = await _db.Person_StateProvince.FirstOrDefaultAsync(x => x.StateProvinceID == stateProvinceID); if (existing == null) { return(NotFound()); } existing.StateProvinceID = value.StateProvinceID; existing.StateProvinceCode = value.StateProvinceCode; existing.CountryRegionCode = value.CountryRegionCode; existing.IsOnlyStateProvinceFlag = value.IsOnlyStateProvinceFlag; existing.Name = value.Name; existing.TerritoryID = value.TerritoryID; existing.rowguid = value.rowguid; existing.ModifiedDate = value.ModifiedDate; _db.Person_StateProvince.Update(existing); await _db.SaveChangesAsync(); return(NoContent()); }