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)); }
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); }