Created
November 6, 2018 02:52
-
-
Save jasongaylord/f4b824f341fc38cc6fa2847bd919e275 to your computer and use it in GitHub Desktop.
Part of the https://gist.github.com/jasongaylord/df33fe4cd4bc7d253a10c3cdccc41104#file-default-cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection.Extensions; | |
using TwitterViewComponent; | |
namespace Microsoft.Extensions.DependencyInjection | |
{ | |
public static class ServiceCollectionExtensions | |
{ | |
public static IServiceCollection AddTwitter(this IServiceCollection services, IConfiguration configuration = null) | |
{ | |
if (configuration != null) | |
services.Configure<TwitterOptions>(configuration); | |
else | |
services.TryAddSingleton<TwitterOptions, TwitterOptions>(); | |
services.TryAddScoped<ITwitterService, TwitterService>(); | |
return services; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment