コード例 #1
0
        protected E2ETestBase(ITestOutputHelper output)
        {
            _output = output;

            var serviceProvider = ConfigureDesignTimeServices(
                new ServiceCollection()
                .AddScaffolding()
                .AddLogging())
                                  .AddSingleton(typeof(IFileService), sp => InMemoryFiles = new InMemoryFileService()).BuildServiceProvider();

            _logger = new InMemoryCommandLogger("E2ETest", _output);
            serviceProvider.GetService <ILoggerFactory>().AddProvider(new TestLoggerProvider(_logger));

            Generator = serviceProvider.GetRequiredService <ReverseEngineeringGenerator>();
            ScaffoldingModelFactory = serviceProvider.GetRequiredService <IScaffoldingModelFactory>();
        }
コード例 #2
0
        protected E2ETestBase(ITestOutputHelper output)
        {
            _output = output;

            var serviceProvider = ConfigureDesignTimeServices(
                new ServiceCollection()
                    .AddScaffolding()
                    .AddLogging())
                .AddSingleton(typeof(IFileService), sp => InMemoryFiles = new InMemoryFileService()).BuildServiceProvider();

            _logger = new InMemoryCommandLogger("E2ETest", _output);
            serviceProvider.GetService<ILoggerFactory>().AddProvider(new TestLoggerProvider(_logger));

            Generator = serviceProvider.GetRequiredService<ReverseEngineeringGenerator>();
            ScaffoldingModelFactory = serviceProvider.GetRequiredService<IScaffoldingModelFactory>();
        }