コード例 #1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();

            var dbConnection = Configuration.GetConnectionString("ProjectDb");

            services.AddDbContext <ProjectDbContext>(options => options.UseSqlite(dbConnection, b => b.MigrationsAssembly("Project.Web")));

            var bootstrapper = new Bootstrapper();

            Entity.DepCon = new SimpleDependencyContainer();

            bootstrapper.Init(Entity.DepCon, GetDbConstructor(dbConnection));
        }