コード例 #1
0
        public IGithubVersionProvider Create(GithubVersionProviderSource source)
        {
            Type serviceType;

            switch (source)
            {
            case GithubVersionProviderSource.Branches:
                serviceType = typeof(BranchGithubVersionProvider);
                break;

            case GithubVersionProviderSource.Releases:
            default:
                serviceType = typeof(ReleaseGithubVersionProvider);
                break;
            }

            return((IGithubVersionProvider)ServiceProvider.GetRequiredService(serviceType));
        }
コード例 #2
0
        public async Task<IReadOnlyList<GithubVersion>> GetVersionsAsync(string name, string repositoryName, string token, GithubVersionProviderSource githubVersionProviderSource)
        {
            var _provider = _githubVersionProviderFactory.Create(githubVersionProviderSource);

            return await _provider.GetVersions(name, repositoryName, token);
        }