private static IRedirectProvider Create(this IRedirectProvider ignore, List <Template> templates) { var serviceCollection = new ServiceCollection(); serviceCollection.AddSingleton <IEnumerable <Template> >(templates); return(ignore.Create(serviceCollection)); }
private static IRedirectProvider Create(this IRedirectProvider ignore, Template redirectTemplate) { var templates = new List <Template>() { redirectTemplate }; return(ignore.Create(templates)); }
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); }
internal static IRedirectProvider Create(this IRedirectProvider ignore, String redirectTemplateText) { var redirectTemplate = new Template() { Content = redirectTemplateText, TemplateType = Enumerations.TemplateType.Redirect }; return ignore.Create(redirectTemplate); }
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; }
/// <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; }
private static IRedirectProvider Create(this IRedirectProvider ignore, IServiceCollection serviceCollection) { return new RedirectProvider(serviceCollection.BuildServiceProvider()); }