public async Task <ValidationResult> ValidateUpdateAsync(int id, ApiVStateProvinceCountryRegionRequestModel model) { this.CountryRegionCodeRules(); this.CountryRegionNameRules(); this.IsOnlyStateProvinceFlagRules(); this.StateProvinceCodeRules(); this.StateProvinceNameRules(); this.TerritoryIDRules(); return(await this.ValidateAsync(model, id)); }
private async Task <ApiVStateProvinceCountryRegionRequestModel> PatchModel(int id, JsonPatchDocument <ApiVStateProvinceCountryRegionRequestModel> patch) { var record = await this.VStateProvinceCountryRegionService.Get(id); if (record == null) { return(null); } else { ApiVStateProvinceCountryRegionRequestModel request = this.VStateProvinceCountryRegionModelMapper.MapResponseToRequest(record); patch.ApplyTo(request); return(request); } }
public void MapModelToBO() { var mapper = new BOLVStateProvinceCountryRegionMapper(); ApiVStateProvinceCountryRegionRequestModel model = new ApiVStateProvinceCountryRegionRequestModel(); model.SetProperties("A", "A", true, "A", "A", 1); BOVStateProvinceCountryRegion response = mapper.MapModelToBO(1, model); response.CountryRegionCode.Should().Be("A"); response.CountryRegionName.Should().Be("A"); response.IsOnlyStateProvinceFlag.Should().Be(true); response.StateProvinceCode.Should().Be("A"); response.StateProvinceName.Should().Be("A"); response.TerritoryID.Should().Be(1); }
public void MapResponseToRequest() { var mapper = new ApiVStateProvinceCountryRegionModelMapper(); var model = new ApiVStateProvinceCountryRegionResponseModel(); model.SetProperties(1, "A", "A", true, "A", "A", 1); ApiVStateProvinceCountryRegionRequestModel response = mapper.MapResponseToRequest(model); response.CountryRegionCode.Should().Be("A"); response.CountryRegionName.Should().Be("A"); response.IsOnlyStateProvinceFlag.Should().Be(true); response.StateProvinceCode.Should().Be("A"); response.StateProvinceName.Should().Be("A"); response.TerritoryID.Should().Be(1); }
public virtual BOVStateProvinceCountryRegion MapModelToBO( int stateProvinceID, ApiVStateProvinceCountryRegionRequestModel model ) { BOVStateProvinceCountryRegion boVStateProvinceCountryRegion = new BOVStateProvinceCountryRegion(); boVStateProvinceCountryRegion.SetProperties( stateProvinceID, model.CountryRegionCode, model.CountryRegionName, model.IsOnlyStateProvinceFlag, model.StateProvinceCode, model.StateProvinceName, model.TerritoryID); return(boVStateProvinceCountryRegion); }
public void CreatePatch() { var mapper = new ApiVStateProvinceCountryRegionModelMapper(); var model = new ApiVStateProvinceCountryRegionRequestModel(); model.SetProperties("A", "A", true, "A", "A", 1); JsonPatchDocument <ApiVStateProvinceCountryRegionRequestModel> patch = mapper.CreatePatch(model); var response = new ApiVStateProvinceCountryRegionRequestModel(); patch.ApplyTo(response); response.CountryRegionCode.Should().Be("A"); response.CountryRegionName.Should().Be("A"); response.IsOnlyStateProvinceFlag.Should().Be(true); response.StateProvinceCode.Should().Be("A"); response.StateProvinceName.Should().Be("A"); response.TerritoryID.Should().Be(1); }