예제 #1
0
        private void ConfigureServices(IConfiguration configuration, IServiceCollection services)
        {
            new InfrastructureInstaller().Install(services, DependencyInjectionService);
            InstallerHelper.Install <EntityFrameworkInfrastructureInstaller>(services);
            InstallerHelper.Install <BusinessInstaller>(services);
            InstallerHelper.Install <CoreInstaller>(services);
            InstallerHelper.Install <AppInstaller>(services);

            services.AddDbContext <TicTacToeDbContext>(options => options.UseSqlServer(configuration.GetConnectionString("DefaultConnection")), ServiceLifetime.Transient);
            services.AddSingleton(provider => new Func <DbContext>(provider.GetRequiredService <TicTacToeDbContext>));

            DependencyInjectionService.Build(services);
        }