private async Task <MopViewModel> GetMopViewModel(int id) { Mop parsed = await ApiManager.GetMopAsync(id); MopViewModel mopView = new MopViewModel(parsed); return(mopView); }
private bool FilterCondition(MopViewModel mop, string[] filters) { foreach (string filter in filters) { if (!mop.Facilities[filter]) { return(false); } } return(true); }
private bool SearchCondition(MopViewModel mop, string searchPhrase) { if (searchPhrase == null) { return(true); } foreach (string word in searchPhrase.Split()) { if (!SearchConditionWord(mop, word)) { return(false); } } return(true); }
private bool SearchConditionWord(MopViewModel mop, string searchPhrase) { return((mop.Title.ToLower().Contains(searchPhrase)) || (mop.RoadNumber.ToLower().Contains(searchPhrase)) || (mop.Direction.ToLower().Contains(searchPhrase)) || (mop.Town.ToLower().Contains(searchPhrase))); }