當前位置: 首頁>>代碼示例>>C#>>正文


C# StacMan.ApiUrlBuilder類代碼示例

本文整理匯總了C#中StackExchange.StacMan.ApiUrlBuilder的典型用法代碼示例。如果您正苦於以下問題:C# ApiUrlBuilder類的具體用法?C# ApiUrlBuilder怎麽用?C# ApiUrlBuilder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ApiUrlBuilder類屬於StackExchange.StacMan命名空間,在下文中一共展示了ApiUrlBuilder類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ValidateString

        Task<StacManResponse<Question>> ISearchMethods.GetMatches(string site, string filter, int? page, int? pagesize, DateTime? fromdate, DateTime? todate, Questions.SearchSort? sort, DateTime? mindate, DateTime? maxdate, int? min, int? max, Order? order, string tagged, string nottagged, string intitle)
        {
            ValidateString(site, "site");
            ValidatePaging(page, pagesize);
            ValidateSortMinMax(sort, mindate: mindate, maxdate: maxdate, min: min, max: max);

            var ub = new ApiUrlBuilder(Version, "/search", useHttps: false);

            ub.AddParameter("site", site);
            ub.AddParameter("filter", filter);
            ub.AddParameter("page", page);
            ub.AddParameter("pagesize", pagesize);
            ub.AddParameter("fromdate", fromdate);
            ub.AddParameter("todate", todate);
            ub.AddParameter("sort", sort);
            ub.AddParameter("min", mindate);
            ub.AddParameter("max", maxdate);
            ub.AddParameter("min", min);
            ub.AddParameter("max", max);
            ub.AddParameter("order", order);
            ub.AddParameter("tagged", tagged);
            ub.AddParameter("nottagged", nottagged);
            ub.AddParameter("intitle", intitle);

            return CreateApiTask<Question>(ub, HttpMethod.GET, "/search");
        }
開發者ID:RobTillie,項目名稱:StacMan,代碼行數:26,代碼來源:StacManClient.SearchMethods.cs

示例2: ValidateAndGetFilter

        Task<StacManResponse<Post>> IPostMethods.GetByIds(string site, IEnumerable<int> ids, string filter = null, int? page = null, int? pagesize = null, DateTime? fromdate = null, DateTime? todate = null, Posts.Sort? sort = null, DateTime? mindate = null, DateTime? maxdate = null, int? min = null, int? max = null, Order? order = null)
        {
            var filterObj = ValidateAndGetFilter(filter);

            ValidateString(site, "site");
            ValidateEnumerable(ids, "ids");
            ValidatePaging(page, pagesize);
            ValidateSortMinMax(sort, mindate: mindate, maxdate: maxdate, min: min, max: max);

            var ub = new ApiUrlBuilder(String.Format("/posts/{0}", String.Join(";", ids)), useHttps: false);

            ub.AddParameter("site", site);
            ub.AddParameter("filter", filter);
            ub.AddParameter("page", page);
            ub.AddParameter("pagesize", pagesize);
            ub.AddParameter("fromdate", fromdate);
            ub.AddParameter("todate", todate);
            ub.AddParameter("sort", sort);
            ub.AddParameter("min", mindate);
            ub.AddParameter("max", maxdate);
            ub.AddParameter("min", min);
            ub.AddParameter("max", max);
            ub.AddParameter("order", order);

            return CreateApiTask<Post>(ub, filterObj, "/posts/{ids}");
        }
開發者ID:RyannosaurusRex,項目名稱:StacMan,代碼行數:26,代碼來源:StacManClient.PostMethods.cs

示例3: ValidateAndGetFilter

        Task<StacManResponse<Answer>> IAnswerMethods.GetAll(string site, string filter = null, int? page = null, int? pagesize = null, DateTime? fromdate = null, DateTime? todate = null, Answers.Sort? sort = null, DateTime? mindate = null, DateTime? maxdate = null, int? min = null, int? max = null, Order? order = null)
        {
            var filterObj = ValidateAndGetFilter(filter);

            ValidateString(site, "site");
            ValidatePaging(page, pagesize);
            ValidateSortMinMax(sort, mindate: mindate, maxdate: maxdate, min: min, max: max);

            var ub = new ApiUrlBuilder("/answers", useHttps: false);

            ub.AddParameter("site", site);
            ub.AddParameter("filter", filter);
            ub.AddParameter("page", page);
            ub.AddParameter("pagesize", pagesize);
            ub.AddParameter("fromdate", fromdate);
            ub.AddParameter("todate", todate);
            ub.AddParameter("sort", sort);
            ub.AddParameter("min", mindate);
            ub.AddParameter("max", maxdate);
            ub.AddParameter("min", min);
            ub.AddParameter("max", max);
            ub.AddParameter("order", order);

            return CreateApiTask<Answer>(ub, filterObj, "/answers");
        }
開發者ID:RyannosaurusRex,項目名稱:StacMan,代碼行數:25,代碼來源:StacManClient.AnswerMethods.cs

示例4: ValidateAndGetFilter

        Task<StacManResponse<Badge>> IBadgeMethods.GetByIds(string site, IEnumerable<int> ids, string filter = null, int? page = null, int? pagesize = null, DateTime? fromdate = null, DateTime? todate = null, Badges.AllSort? sort = null, Badges.Rank? minrank = null, Badges.Rank? maxrank = null, string minname = null, string maxname = null, Badges.BadgeType? mintype = null, Badges.BadgeType? maxtype = null, Order? order = null)
        {
            var filterObj = ValidateAndGetFilter(filter);

            ValidateString(site, "site");
            ValidateEnumerable(ids, "ids");
            ValidatePaging(page, pagesize);
            ValidateSortMinMax(sort, minrank: minrank, maxrank: maxrank, minname: minname, maxname: maxname, mintype: mintype, maxtype: maxtype);

            var ub = new ApiUrlBuilder(String.Format("/badges/{0}", String.Join(";", ids)), useHttps: false);

            ub.AddParameter("site", site);
            ub.AddParameter("filter", filter);
            ub.AddParameter("page", page);
            ub.AddParameter("pagesize", pagesize);
            ub.AddParameter("fromdate", fromdate);
            ub.AddParameter("todate", todate);
            ub.AddParameter("sort", sort);
            ub.AddParameter("min", minrank);
            ub.AddParameter("max", maxrank);
            ub.AddParameter("min", minname);
            ub.AddParameter("max", maxname);
            ub.AddParameter("min", mintype);
            ub.AddParameter("max", maxtype);
            ub.AddParameter("order", order);

            return CreateApiTask<Badge>(ub, filterObj, "/badges/{ids}");
        }
開發者ID:RyannosaurusRex,項目名稱:StacMan,代碼行數:28,代碼來源:StacManClient.BadgeMethods.cs

示例5: ValidateString

        Task<StacManResponse<Badge>> IBadgeMethods.GetAll(string site, string filter, int? page, int? pagesize, DateTime? fromdate, DateTime? todate, Badges.AllSort? sort, Badges.Rank? minrank, Badges.Rank? maxrank, string minname, string maxname, Badges.BadgeType? mintype, Badges.BadgeType? maxtype, Order? order, string inname)
        {
            ValidateString(site, "site");
            ValidatePaging(page, pagesize);
            ValidateSortMinMax(sort, minrank: minrank, maxrank: maxrank, minname: minname, maxname: maxname, mintype: mintype, maxtype: maxtype);

            var ub = new ApiUrlBuilder(Version, "/badges", useHttps: false);

            ub.AddParameter("site", site);
            ub.AddParameter("filter", filter);
            ub.AddParameter("page", page);
            ub.AddParameter("pagesize", pagesize);
            ub.AddParameter("fromdate", fromdate);
            ub.AddParameter("todate", todate);
            ub.AddParameter("sort", sort);
            ub.AddParameter("min", minrank);
            ub.AddParameter("max", maxrank);
            ub.AddParameter("min", minname);
            ub.AddParameter("max", maxname);
            ub.AddParameter("min", mintype);
            ub.AddParameter("max", maxtype);
            ub.AddParameter("order", order);
            ub.AddParameter("inname", inname);

            return CreateApiTask<Badge>(ub, HttpMethod.GET, "/badges");
        }
開發者ID:RobTillie,項目名稱:StacMan,代碼行數:26,代碼來源:StacManClient.BadgeMethods.cs

示例6: ValidateAndGetFilter

        Task<StacManResponse<Question>> ISearchMethods.GetSimilar(string site, string filter = null, int? page = null, int? pagesize = null, DateTime? fromdate = null, DateTime? todate = null, Questions.SearchSort? sort = null, DateTime? mindate = null, DateTime? maxdate = null, int? min = null, int? max = null, Order? order = null, string tagged = null, string nottagged = null, string inttitle = null)
        {
            var filterObj = ValidateAndGetFilter(filter);

            ValidateString(site, "site");
            ValidatePaging(page, pagesize);
            ValidateSortMinMax(sort, mindate: mindate, maxdate: maxdate, min: min, max: max);

            var ub = new ApiUrlBuilder("/similar", useHttps: false);

            ub.AddParameter("site", site);
            ub.AddParameter("filter", filter);
            ub.AddParameter("page", page);
            ub.AddParameter("pagesize", pagesize);
            ub.AddParameter("fromdate", fromdate);
            ub.AddParameter("todate", todate);
            ub.AddParameter("sort", sort);
            ub.AddParameter("min", mindate);
            ub.AddParameter("max", maxdate);
            ub.AddParameter("min", min);
            ub.AddParameter("max", max);
            ub.AddParameter("order", order);
            ub.AddParameter("tagged", tagged);
            ub.AddParameter("nottagged", nottagged);
            ub.AddParameter("inttitle", inttitle);

            return CreateApiTask<Question>(ub, filterObj, "/similar");
        }
開發者ID:RyannosaurusRex,項目名稱:StacMan,代碼行數:28,代碼來源:StacManClient.SearchMethods.cs

示例7: ApiUrlBuilder

        Task<StacManResponse<Error>> IErrorMethods.Simulate(int id, string filter)
        {
            var ub = new ApiUrlBuilder(Version, String.Format("/errors/{0}", id), useHttps: false);

            ub.AddParameter("filter", filter);

            return CreateApiTask<Error>(ub, HttpMethod.GET, "/errors/{id}");
        }
開發者ID:RobTillie,項目名稱:StacMan,代碼行數:8,代碼來源:StacManClient.ErrorMethods.cs

示例8: ValidateEnumerable

        Task<StacManResponse<Filter>> IFilterMethods.Read(IEnumerable<string> filters, string filter)
        {
            ValidateEnumerable(filters, "filters");

            var ub = new ApiUrlBuilder(Version, String.Format("/filters/{0}", String.Join(";", filters.Select(HttpUtility.UrlEncode))), useHttps: false);

            ub.AddParameter("filter", filter);

            return CreateApiTask<Filter>(ub, HttpMethod.GET, "/filters/{filters}");
        }
開發者ID:RobTillie,項目名稱:StacMan,代碼行數:10,代碼來源:StacManClient.FilterMethods.cs

示例9: ValidateAndGetFilter

        Task<StacManResponse<Error>> IErrorMethods.Simulate(int id, string filter = null)
        {
            var filterObj = ValidateAndGetFilter(filter);


            var ub = new ApiUrlBuilder(String.Format("/errors/{0}", id), useHttps: false);

            ub.AddParameter("filter", filter);

            return CreateApiTask<Error>(ub, filterObj, "/errors/{id}");
        }
開發者ID:RyannosaurusRex,項目名稱:StacMan,代碼行數:11,代碼來源:StacManClient.ErrorMethods.cs

示例10: ValidateString

        Task<StacManResponse<Info>> IInfoMethods.Get(string site, string filter)
        {
            ValidateString(site, "site");

            var ub = new ApiUrlBuilder(Version, "/info", useHttps: false);

            ub.AddParameter("site", site);
            ub.AddParameter("filter", filter);

            return CreateApiTask<Info>(ub, HttpMethod.GET, "/info");
        }
開發者ID:RobTillie,項目名稱:StacMan,代碼行數:11,代碼來源:StacManClient.InfoMethods.cs

示例11: ApiUrlBuilder

        Task<StacManResponse<Filter>> IFilterMethods.Create(string filter, IEnumerable<string> include, IEnumerable<string> exclude, string @base, bool? @unsafe)
        {
            var ub = new ApiUrlBuilder(Version, "/filters/create", useHttps: false);

            ub.AddParameter("filter", filter);
            ub.AddParameter("include", include);
            ub.AddParameter("exclude", exclude);
            ub.AddParameter("base", @base);
            ub.AddParameter("unsafe", @unsafe);

            return CreateApiTask<Filter>(ub, HttpMethod.GET, "/filters/create");
        }
開發者ID:RobTillie,項目名稱:StacMan,代碼行數:12,代碼來源:StacManClient.FilterMethods.cs

示例12: ValidateAndGetFilter

        Task<StacManResponse<Filter>> IFilterMethods.Read(IEnumerable<string> filters, string filter = null)
        {
            var filterObj = ValidateAndGetFilter(filter);

            ValidateEnumerable(filters, "filters");

            var ub = new ApiUrlBuilder(String.Format("/filters/{0}", String.Join(";", filters)), useHttps: false);

            ub.AddParameter("filter", filter);

            return CreateApiTask<Filter>(ub, filterObj, "/filters/{filters}");
        }
開發者ID:RyannosaurusRex,項目名稱:StacMan,代碼行數:12,代碼來源:StacManClient.FilterMethods.cs

示例13: ValidatePaging

        Task<StacManResponse<Error>> IErrorMethods.GetAll(string filter, int? page, int? pagesize)
        {
            ValidatePaging(page, pagesize);

            var ub = new ApiUrlBuilder(Version, "/errors", useHttps: false);

            ub.AddParameter("filter", filter);
            ub.AddParameter("page", page);
            ub.AddParameter("pagesize", pagesize);

            return CreateApiTask<Error>(ub, HttpMethod.GET, "/errors");
        }
開發者ID:RobTillie,項目名稱:StacMan,代碼行數:12,代碼來源:StacManClient.ErrorMethods.cs

示例14: ValidateEnumerable

        Task<StacManResponse<AccessToken>> IAccessTokenMethods.Invalidate(IEnumerable<string> accessTokens, string filter, int? page, int? pagesize)
        {
            ValidateEnumerable(accessTokens, "accessTokens");
            ValidatePaging(page, pagesize);

            var ub = new ApiUrlBuilder(Version, String.Format("/access-tokens/{0}/invalidate", String.Join(";", accessTokens.Select(HttpUtility.UrlEncode))), useHttps: false);

            ub.AddParameter("filter", filter);
            ub.AddParameter("page", page);
            ub.AddParameter("pagesize", pagesize);

            return CreateApiTask<AccessToken>(ub, HttpMethod.GET, "/access-tokens/{accessTokens}/invalidate");
        }
開發者ID:RobTillie,項目名稱:StacMan,代碼行數:13,代碼來源:StacManClient.AccessTokenMethods.cs

示例15: ValidateAndGetFilter

        Task<StacManResponse<Site>> ISiteMethods.GetAll(string filter = null, int? page = null, int? pagesize = null)
        {
            var filterObj = ValidateAndGetFilter(filter);

            ValidatePaging(page, pagesize);

            var ub = new ApiUrlBuilder("/sites", useHttps: false);

            ub.AddParameter("filter", filter);
            ub.AddParameter("page", page);
            ub.AddParameter("pagesize", pagesize);

            return CreateApiTask<Site>(ub, filterObj, "/sites");
        }
開發者ID:RyannosaurusRex,項目名稱:StacMan,代碼行數:14,代碼來源:StacManClient.SiteMethods.cs


注:本文中的StackExchange.StacMan.ApiUrlBuilder類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。