Esempio n. 1
0
        private static IRedirectProvider Create(this IRedirectProvider ignore, List <Template> templates)
        {
            var serviceCollection = new ServiceCollection();

            serviceCollection.AddSingleton <IEnumerable <Template> >(templates);
            return(ignore.Create(serviceCollection));
        }
Esempio n. 2
0
        private static IRedirectProvider Create(this IRedirectProvider ignore, Template redirectTemplate)
        {
            var templates = new List <Template>()
            {
                redirectTemplate
            };

            return(ignore.Create(templates));
        }
Esempio n. 3
0
        internal static IRedirectProvider Create(this IRedirectProvider ignore, List<Template> templates)
        {
            var serviceCollection = new ServiceCollection();

            var templateRepo = new Mock<ITemplateRepository>();
            templateRepo.Setup(r => r.GetAllTemplates()).Returns(templates);
            serviceCollection.AddSingleton<ITemplateRepository>(templateRepo.Object);

            return ignore.Create(serviceCollection);
        }
Esempio n. 4
0
        internal static IRedirectProvider Create(this IRedirectProvider ignore, String redirectTemplateText)
        {
            var redirectTemplate = new Template()
            {
                Content = redirectTemplateText,
                TemplateType = Enumerations.TemplateType.Redirect
            };

            return ignore.Create(redirectTemplate);
        }
Esempio n. 5
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);
        }
 public RedirectController(IRedirectProvider redirectProvider, ISiteConfiguration siteConfiguration)
 {
     _redirectProvider = redirectProvider;
     _siteConfiguration = siteConfiguration;
 }
Esempio n. 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RedirectService"/> type.
 /// </summary>
 /// <param name="redirectProvider">The redirect provider.</param>
 public RedirectService(IRedirectProvider redirectProvider)
 {
     this._redirectProvider = redirectProvider;
 }
Esempio n. 8
0
 private static IRedirectProvider Create(this IRedirectProvider ignore, IServiceCollection serviceCollection)
 {
     return new RedirectProvider(serviceCollection.BuildServiceProvider());
 }
Esempio n. 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RedirectService"/> type.
 /// </summary>
 /// <param name="redirectProvider">The redirect provider.</param>
 public RedirectService(IRedirectProvider redirectProvider)
 {
     this._redirectProvider = redirectProvider;
 }
 public RedirectController(IRedirectProvider redirectProvider, ISiteConfiguration siteConfiguration)
 {
     _redirectProvider  = redirectProvider;
     _siteConfiguration = siteConfiguration;
 }