Exemplo n.º 1
0
        public List <tbl_POI> SearchPOIs(string search, int?categoryID, int[] tagIDs)
        {
            if (!String.IsNullOrEmpty(search))
            {
                search = search.ToLower();
            }
            var pois = POIRepository.GetAll().ToList().Where(p =>
                                                             (String.IsNullOrEmpty(search) || (p.POI_Title ?? String.Empty).ToLower().Contains(search) || (p.tbl_Address.A_County ?? String.Empty).ToLower().Contains(search) || (p.tbl_Address.A_Town ?? String.Empty).ToLower().Contains(search)) &&
                                                             (!categoryID.HasValue || categoryID.Value == 0 || p.POI_CategoryID == categoryID.Value) &&
                                                             (tagIDs == null || tagIDs.Count() == 0 || p.tbl_POITags.Any(t => tagIDs.Contains(t.POITagID)))
                                                             ).ToList();

            return(pois);
        }
Exemplo n.º 2
0
 public List <tbl_POI> GetAllPOIs()
 {
     return(POIRepository.GetAll().ToList());
 }