当前位置: 首页>>代码示例>>C#>>正文


C# ApiUrlBuilder.AddParameter方法代码示例

本文整理汇总了C#中StackExchange.StacMan.ApiUrlBuilder.AddParameter方法的典型用法代码示例。如果您正苦于以下问题:C# ApiUrlBuilder.AddParameter方法的具体用法?C# ApiUrlBuilder.AddParameter怎么用?C# ApiUrlBuilder.AddParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StackExchange.StacMan.ApiUrlBuilder的用法示例。


在下文中一共展示了ApiUrlBuilder.AddParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: ValidateString

        Task<StacManResponse<Privilege>> IPrivilegeMethods.GetAll(string site, string filter, int? page, int? pagesize)
        {
            ValidateString(site, "site");
            ValidatePaging(page, pagesize);

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

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

            return CreateApiTask<Privilege>(ub, HttpMethod.GET, "/privileges");
        }
开发者ID:RobTillie,项目名称:StacMan,代码行数:14,代码来源:StacManClient.PrivilegeMethods.cs

示例7: ValidateString

        Task<StacManResponse<InboxItem>> IInboxMethods.Get(string access_token, string filter, int? page, int? pagesize)
        {
            ValidateString(access_token, "access_token");
            ValidatePaging(page, pagesize);

            var ub = new ApiUrlBuilder(Version, "/inbox", useHttps: true);

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

            return CreateApiTask<InboxItem>(ub, HttpMethod.GET, "/inbox");
        }
开发者ID:RobTillie,项目名称:StacMan,代码行数:14,代码来源:StacManClient.InboxMethods.cs

示例8: 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

示例9: ValidateAndGetFilter

        Task<StacManResponse<AccessToken>> IAccessTokenMethods.Get(IEnumerable<string> accessTokens, string filter = null, int? page = null, int? pagesize = null)
        {
            var filterObj = ValidateAndGetFilter(filter);

            ValidateEnumerable(accessTokens, "accessTokens");
            ValidatePaging(page, pagesize);

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

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

            return CreateApiTask<AccessToken>(ub, filterObj, "/access-tokens/{accessTokens}");
        }
开发者ID:RyannosaurusRex,项目名称:StacMan,代码行数:15,代码来源:StacManClient.AccessTokenMethods.cs

示例10: ValidateString

        Task<StacManResponse<Comment>> ICommentMethods.Delete(string site, string access_token, int id, string filter, bool? preview)
        {
            ValidateString(site, "site");
            ValidateString(access_token, "access_token");
            ValidateMinApiVersion("2.1");

            var ub = new ApiUrlBuilder(Version, String.Format("/comments/{0}/delete", id), useHttps: true);

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

            return CreateApiTask<Comment>(ub, HttpMethod.POST, "/comments/{id}/delete");
        }
开发者ID:RobTillie,项目名称:StacMan,代码行数:15,代码来源:StacManClient.CommentMethods.cs

示例11: ValidateString

        Task<StacManResponse<Notification>> INotificationMethods.GetUnread(string access_token, string filter, int? page, int? pagesize)
        {
            ValidateString(access_token, "access_token");
            ValidateMinApiVersion("2.1");
            ValidatePaging(page, pagesize);

            var ub = new ApiUrlBuilder(Version, "/notifications/unread", useHttps: true);

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

            return CreateApiTask<Notification>(ub, HttpMethod.GET, "/notifications/unread");
        }
开发者ID:RobTillie,项目名称:StacMan,代码行数:15,代码来源:StacManClient.NotificationMethods.cs

示例12: ValidateAndGetFilter

        Task<StacManResponse<Filter>> IFilterMethods.Create(string filter = null, IEnumerable<string> include = null, IEnumerable<string> exclude = null, string @base = null, bool? @unsafe = null)
        {
            var filterObj = ValidateAndGetFilter(filter);


            var ub = new ApiUrlBuilder("/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, filterObj, "/filters/create");
        }
开发者ID:RyannosaurusRex,项目名称:StacMan,代码行数:15,代码来源:StacManClient.FilterMethods.cs

示例13: ValidateAndGetFilter

        Task<StacManResponse<InboxItem>> IInboxMethods.Get(string access_token, string filter = null, int? page = null, int? pagesize = null)
        {
            var filterObj = ValidateAndGetFilter(filter);

            ValidateString(access_token, "access_token");
            ValidatePaging(page, pagesize);

            var ub = new ApiUrlBuilder("/inbox", useHttps: true);

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

            return CreateApiTask<InboxItem>(ub, filterObj, "/inbox");
        }
开发者ID:RyannosaurusRex,项目名称:StacMan,代码行数:16,代码来源:StacManClient.InboxMethods.cs

示例14: 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

示例15: 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


注:本文中的StackExchange.StacMan.ApiUrlBuilder.AddParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。