Sibusiso Madlopha

Sibusiso Madlopha

  • NA
  • 140
  • 863

ERROR Value cannot be null. Parameter name: source.

Oct 20 2018 11:57 AM
[HttpPost]
public ActionResult Search(DemoSearchModel model)
{
switch(model.SearchType)
{ case SearchTypeEnum.City:
var cities = new ESBFeedsService().QueryCityList().Data.Select(d=>d.ToObjectMap<CityDto>(false)).ToList();
var modelCities = new DisplayPropertyModels().Build(cities.ToList(),model.SearchType);
return View(modelCities);
case SearchTypeEnum.Property:
// var service = new ESBFeedsService();
var properties =new ESBFeedsService().QueryPropertyList().Data.Select(d => d.ToObjectMap<PropertyDto>(false)).ToList();
var modelProperties = new DisplayPropertyModels().Build(properties.ToList(), model.SearchType);
return View(modelProperties);
case SearchTypeEnum.Company:
var companies = new ESBFeedsService().QueryCompanyList().Data.Select(d => d.ToObjectMap<CompanyDto>(false)).ToList();
var modelC = new DisplayPropertyModels().Build(companies, model.SearchType);
return View(modelC);
case SearchTypeEnum.State:
var states = new ESBFeedsService().QueryStateList().Data.Select(d => d.ToObjectMap<StateDto>(false)).ToList();
var modelPt = new DisplayPropertyModels().Build(states, model.SearchType);
return View(modelPt);
}
return View();
}

Answers (2)