Example #1
0
        //this method also gets called by runtime, use to configure http request pipeline
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, GrapherContext db)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error/");
            }

            app.UseStaticFiles();
            app.UseSpaStaticFiles() :
                app.UseGraphiQl();
            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller}/{action=Index}/{id?}");
            });
            app.UseSpaStaticFiles(spa =>
            {
                spa.Options.SourcePath = "ClientApp";

                if (env.IsDevelopment())
                {
                    spa.UseReactDevelopmentServer(npmScript: "start");
                }
            });
            db.EnsureSeedData();
        }
Example #2
0
 public FlightRepository(GrapherContext db)
 {
     _db = db;
 }
Example #3
0
 public AircraftRepository(GrapherContext db)
 {
     _db = db;
 }