Beispiel #1
0
        public static IServiceCollection Create(this IServiceCollection ignore, IContentRepository contentRepo, IArchiveProvider archiveProvider, IContactProvider contactProvider, ISearchProvider searchProvider, IPageGenerator pageGen, IHomePageGenerator homePageGen, INavigationProvider navProvider, IRedirectProvider redirectProvider, ISyndicationProvider syndicationProvider, ISettings settings, IEnumerable <Category> categories, IContentEncoder contentEncoder, IContentItemPageGenerator contentItemPageGen)
        {
            IServiceCollection container = new ServiceCollection();

            container.AddSingleton <IPageGenerator>(pageGen);
            container.AddSingleton <IHomePageGenerator>(homePageGen);
            container.AddSingleton <INavigationProvider>(navProvider);
            container.AddSingleton <IArchiveProvider>(archiveProvider);
            container.AddSingleton <IContactProvider>(contactProvider);
            container.AddSingleton <ISearchProvider>(searchProvider);
            container.AddSingleton <ISyndicationProvider>(syndicationProvider);
            container.AddSingleton <IEnumerable <Category> >(categories);
            container.AddSingleton <IRedirectProvider>(redirectProvider);
            container.AddSingleton <IContentEncoder>(contentEncoder);
            container.AddSingleton <IContentItemPageGenerator>(contentItemPageGen);

            container.AddSingleton <IContentRepository>(contentRepo);
            settings.SourceConnection = contentRepo.GetSourceConnection();
            container.AddSingleton <ISettings>(settings);

            return(container);
        }
Beispiel #2
0
 public static ISyndicationProvider Create(this ISyndicationProvider ignore, IServiceCollection container)
 {
     return(new SyndicationProvider(container.BuildServiceProvider()));
 }
Beispiel #3
0
 public static ISyndicationProvider Create(this ISyndicationProvider ignore, IServiceProvider serviceProvider)
 {
     return(new SyndicationProvider(serviceProvider));
 }
 public SyndicationController(AppDbContext dbContext, ISyndicationProvider syndicationProvider)
 {
     _dbContext           = dbContext;
     _syndicationProvider = syndicationProvider;
 }