示例#1
0
 public VstsClient(string instanceName, IHttpClient client, VstsClientConfiguration configuration, ILogger <VstsClient> logger)
 {
     _instanceName = instanceName;
     _httpClient   = client;
     _logger       = logger;
     Configuration = configuration;
 }
示例#2
0
 public VstsClient(IVstsUrlBuilderFactory urlBuilderFactory, IHttpClient client, VstsClientConfiguration configuration, ILogger <VstsClient> logger)
 {
     _urlBuilderFactory = urlBuilderFactory;
     _httpClient        = client;
     _logger            = logger;
     Configuration      = configuration;
 }
示例#3
0
        public static VstsClient Get(string instanceName, string accessToken, VstsClientConfiguration configuration = null, ILogger <VstsClient> logger = null)
        {
            var client       = HttpClientUtil.Create(accessToken);
            var httpClient   = new DefaultHttpClient(client, new NullLogger <DefaultHttpClient>());
            var clientLogger = logger ?? new NullLogger <VstsClient>();

            return(new VstsClient(instanceName, httpClient, configuration ?? VstsClientConfiguration.Default, logger ?? clientLogger));
        }
示例#4
0
 public VstsClient(string instanceName, IHttpClient client, VstsClientConfiguration configuration)
     : this(instanceName, client, configuration, new NullLogger <VstsClient>())
 {
 }
示例#5
0
        public static VstsClient Get(IVstsUrlBuilderFactory urlBuilderFactory, string accessToken, VstsClientConfiguration configuration = null, ILogger <VstsClient> logger = null)
        {
            var client       = HttpClientUtil.Create(accessToken);
            var httpClient   = new DefaultHttpClient(client, new NullLogger <DefaultHttpClient>());
            var clientLogger = logger ?? new NullLogger <VstsClient>();

            return(new VstsClient(urlBuilderFactory, httpClient, configuration ?? VstsClientConfiguration.Default, logger ?? clientLogger));
        }
示例#6
0
 public VstsClient(IVstsUrlBuilderFactory urlBuilderFactory, IHttpClient client, VstsClientConfiguration configuration)
     : this(urlBuilderFactory, client, configuration, new NullLogger <VstsClient>())
 {
 }
示例#7
0
        private static VstsClient CreateVstsClient(string instanceName, IServiceProvider ctx, VstsClientConfiguration config)
        {
            var client = ctx.GetService <IHttpClient>();
            var logger = ctx.GetService <ILogger <VstsClient> >();

            return(new VstsClient(instanceName, client, config, logger));
        }