private PlaceViewModel StringToViewModel(string toParse) { if (!string.IsNullOrEmpty(toParse)) { PlaceHitchWikiModel hitchModel = Newtonsoft.Json.JsonConvert.DeserializeObject <PlaceHitchWikiModel>(toParse); PlaceViewModel toReturn = new PlaceViewModel(hitchModel); return(toReturn); } return(null); }
public async Task <PlaceViewModel> GetPlaceDot(int id) { Task <string> getPlaceTask = HttpHelper.GetAsync(string.Format("{0}?place={1}&dot", hitchWikiURI, id)); string result = await getPlaceTask; if (!string.IsNullOrEmpty(result)) { PlaceHitchWikiModel hitchModel = Newtonsoft.Json.JsonConvert.DeserializeObject <PlaceHitchWikiModel>(result); PlaceViewModel toReturn = new PlaceViewModel(hitchModel); return(toReturn); } return(null); }