Пример #1
0
        internal async Task <UpcomingMovieModel> GetAsync(uint page = 1)
        {
            if (page < PageMin ||
                page > PageMax)
            {
                throw new ArgumentException($"[page] must be an integer between {PageMin.ToString()} and {PageMax.ToString()}.", "page");
            }

            var queryCollection = new Dictionary <string, object>
            {
                { "page", page }
            };

            var model = await BaseGetAsync(ServicePath, queryCollection);

            return(model);
        }
Пример #2
0
        internal async Task <SearchMovieModel> GetAsync(string query, uint page = 1)
        {
            if (string.IsNullOrWhiteSpace(query))
            {
                throw new ArgumentException("query");
            }

            if (page < PageMin ||
                page > PageMax)
            {
                throw new ArgumentException($"[page] must be an integer between {PageMin.ToString()} and {PageMax.ToString()}.", "page");
            }

            var queryCollection = new Dictionary <string, object>
            {
                { "query", query.Trim() }
                , { "page", page }
            };

            var model = await BaseGetAsync(ServicePath, queryCollection);

            return(model);
        }