コード例 #1
0
ファイル: Startup.cs プロジェクト: Aaltis/TTWeb-Asp.Net
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDbContext <MovementContext>(options => options.UseNpgsql(Configuration.GetConnectionString("PostgreSql")));

            MovementContext.SeedMovements(Configuration);

            services.AddSingleton <IHttpContextAccessor, HttpContextAccessor>();
            services.AddReact();

            services.Configure <AppSettings>(Configuration.GetSection("AppSettings"));
            // Make sure a JS engine is registered, or you will get an error!
            services.AddJsEngineSwitcher(options => options.DefaultEngineName = V8JsEngine.EngineName)
            .AddV8();

            services.AddControllersWithViews();
        }
コード例 #2
0
 public MovementController(MovementContext movementContext, IOptions <AppSettings> appSettings)
 {
     _movementContext = movementContext;
 }