示例#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));
        }
示例#2
0
        private static IRedirectProvider Create(this IRedirectProvider ignore, Template redirectTemplate)
        {
            var templates = new List <Template>()
            {
                redirectTemplate
            };

            return(ignore.Create(templates));
        }
示例#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);
        }
示例#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);
        }