Пример #1
0
        public IList <Club> Search(double latitude, double longitude, int radius, int[] categories)
        {
            bool hasPoint = latitude != 0D || longitude != 0D;
            bool hasCat   = categories != null && categories.Length > 0;

            if (hasPoint && hasCat)
            {
                return(ClubRepository.FindNearbyInCategory(new GeoPoint(latitude, longitude), radius, categories));
            }
            if (hasPoint && !hasCat)
            {
                return(ClubRepository.FindNearby(new GeoPoint(latitude, longitude), radius));
            }
            if (!hasPoint && hasCat)
            {
                return(ClubRepository.FindInCategory(categories));
            }

            throw Error.RcMapClubService_MustSpecifyPointOrCategory();
        }