// 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(); }
public MovementController(MovementContext movementContext, IOptions <AppSettings> appSettings) { _movementContext = movementContext; }