示例#1
0
        public static IContentsServiceBuilder AddContentsApi(this IContentsServiceBuilder services)
        {
            services.Services
            .AddMvcCore()
            .AddApplicationPart(typeof(ContentServiceDependencyInjectionExtensions).Assembly);

            return(services);
        }
示例#2
0
 public static IContentsServiceBuilder AddAzureMediaLibrary(this IContentsServiceBuilder services)
 {
     services.Services
     .AddMediatR(typeof(AzureMediaLibraryService))
     .Configure <AzureMediaStorageOptions>(services.Configuration.GetSection(AzureMediaSectionName))
     .AddScoped <IMediaLibraryProvider, AzureMediaLibraryService>()
     .AddScoped <AzureStorageClientFactory>()
     .AddScoped <AzureMediaLibraryQuery>()
     .AddScoped <AzureStorageRepository>()
     .AddScoped <MediaContentConverter>()
     .AddScoped <MediaFolderConverter>();
     return(services);
 }
示例#3
0
        public static IContentsServiceBuilder AddContentfulModule(this IContentsServiceBuilder services)
        {
            services.Services
            .AddMediatR(typeof(ContentsService))
            .AddAlaskaCommon()
            .Configure <ContentfulClientOptions>(services.Configuration.GetSection(ContentfulSectionName))
            .AddSingleton <ContentfulClientsFactory>()
            .AddSingleton <FieldAdaptersCollection>()
            .AddScoped <ContentsConverter>()
            .AddScoped <ContentQueries>()
            .AddMemoryCacheInstance <ContentTypesCache>()
            .AddScoped <IContentsProvider, ContentsService>();

            return(services);
        }
示例#4
0
 public static IContentsServiceBuilder AddMediaAuthorization <T>(this IContentsServiceBuilder services)
     where T : class, IMediaLibraryAuthorizationMiddleware
 {
     services.Services.AddScoped <IMediaLibraryAuthorizationMiddleware, T>();
     return(services);
 }