public GitHubRemoteService( IRemoteServiceFactory remoteServiceFactory, IHttpClientFactory httpClientFactory, ILogManager logManager, GitHubSessionContext sessionContext) { _remoteServiceLazy = new Lazy <IRemoteService <IGitHubApiService> >(() => { var logger = logManager.GetLogger <GitHubRemoteService>(); var httpClient = httpClientFactory.CreateAuthClient(ApiUrl, sessionContext, logger); return(remoteServiceFactory.Create <IGitHubApiService>(httpClient)); }); }
public ProfileRemoteService( IRemoteServiceFactory remoteServiceFactory, IHttpClientFactory httpClientFactory, ISessionContext sessionContext, ILogManager logManager, ProfileApiConfig apiConfig) { _remoteServiceLazy = new Lazy <IRemoteService <IProfileApiService> >(() => { var logger = logManager.GetLogger <ProfileRemoteService>(); var httpClient = httpClientFactory.CreateAuthClient(apiConfig.BaseUrl, sessionContext, logger); return(remoteServiceFactory.Create <IProfileApiService>(httpClient)); }); }