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); }