Beispiel #1
0
        public static IServiceProvider BuildServiceProvider()
        {
            var services = new ServiceCollection();

            services.AddLogging((builder) =>
            {
                builder.AddConsole(options =>
                {
                    options.IncludeScopes = true;
                });
                builder.SetMinimumLevel(LogLevel.Trace);
            });

            services.AddRazor();

            services.AddSingleton <RazorRunner>();
            services.AddSingleton <TestInjection>();

            var result = services.BuildServiceProvider();

            return(result);
        }