コード例 #1
0
        public void FindVenues_CanFindVenues()
        {
            var options = new VenueSearchOptions() { Name = "Terminal 5" };

            var results = _client.FindVenues(options);

            Assert.NotNull(results);
            Assert.NotEmpty(results.Venues);
        }
コード例 #2
0
ファイル: Location.cs プロジェクト: ravensorb/SetlistFmApi
        public VenueSearchResult FindVenues(VenueSearchOptions options)
        {
            var request = createVenueSearchRequest(options);

            return executeRequest<VenueSearchResult>(request);
        }
コード例 #3
0
        public void FindVenuesAsync(VenueSearchOptions options, Action<VenueSearchResult> callback)
        {
            var request = createVenueSearchRequest(options);

            executeRequestAsync<VenueSearchResult>(request, callback);
        }
コード例 #4
0
ファイル: Location.cs プロジェクト: ravensorb/SetlistFmApi
        private RestRequest createVenueSearchRequest(VenueSearchOptions options)
        {
            var request = new RestRequest();
            request.Resource = "search/venues";

            if (!string.IsNullOrEmpty(options.Name))
                request.AddParameter("name", options.Name);

            if (!string.IsNullOrEmpty(options.CityName))
                request.AddParameter("cityName", options.CityName);

            if (!string.IsNullOrEmpty(options.CityId))
                request.AddParameter("cityId", options.CityId);

            if (!string.IsNullOrEmpty(options.StateCode))
                request.AddParameter("stateCode", options.StateCode);

            if (!string.IsNullOrEmpty(options.State))
                request.AddParameter("state", options.State);

            if (!string.IsNullOrEmpty(options.Country))
                request.AddParameter("country", options.Country);

            if (options.Page.HasValue)
                request.AddParameter("p", options.Page.Value);

            return request;
        }