示例#1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, NHLStatsContext db)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            if (env.IsDevelopment())
            {
                app.UseCors(builder =>
                {
                    builder.WithOrigins("https://localhost:5001", "http://localhost:3000", "http://127.0.0.1:4200")
                    .AllowAnyHeader()
                    .AllowAnyMethod()
                    .AllowCredentials();
                });
            }

            //app.UseGraphiQl();

            app.UseGraphQL <NHLStatsSchema>("/graphql");
            app.UseGraphQLPlayground(options: new GraphQLPlaygroundOptions());

            app.UseMvc();
            db.EnsureSeedData();
        }
示例#2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, NHLStatsContext db)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseGraphiQl();
            app.UseMvc();
            db.EnsureSeedData();
        }
 public NHLStatsQuery(IPlayerRepository playerRepository, NHLStatsContext dbContext)
 {
     Field <ListGraphType <PlayerType> >(
         "players",
         resolve: context => {
         return(dbContext.Players.Select(p => new Player {
             Id = p.Id, Name = p.Name
         }));
         //return playerRepository.All();
     });
 }
示例#4
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, NHLStatsContext db)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseWebSockets();
            app.UseGraphQLWebSockets <NHLStatsSchema>("/graphql");
            app.UseGraphiQl("/ui/graphiql", "/graphql");
            app.UseMvc();
            db.EnsureSeedData();
        }
示例#5
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, NHLStatsContext db)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseCors(x => x.AllowAnyHeader().AllowAnyMethod().WithOrigins("http://localhost:8080"));

            app.UseGraphiQl();
            app.UseMvc();
            db.EnsureSeedData();
        }
示例#6
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, NHLStatsContext db)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            app.UseStaticFiles();
            app.UseSpaStaticFiles();


            var playGround = "/ui/playground";
            var options    = new DashboardOptions {
                AppPath = playGround
            };

            app.UseHangfireDashboard("/hangfire", options);
            app.UseGraphQLPlayground(new GraphQLPlaygroundOptions()
            {
                Path = playGround
            });
            app.UseGraphiQl();


            // app.UseMvc();
            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller}/{action=Index}/{id?}");
            });
            // Azure SignalR
            app.UseAzureSignalR(routes => {
                routes.MapHub <NotificationHub>("/notifications");
            });
            app.UseSpa(spa =>
            {
                spa.Options.SourcePath = "clientApp";

                if (env.IsDevelopment())
                {
                    spa.UseReactDevelopmentServer(npmScript: "start");
                }
            });

            db.EnsureSeedData();
        }
 public PlayerRepository(NHLStatsContext db)
 {
     _db = db;
 }
示例#8
0
 public PlayerRepository(NHLStatsContext db, ILogger <PlayerRepository> logger, IProcessor processor)
 {
     _db        = db;
     _logger    = logger;
     _processor = processor;
 }
 public SkaterStatisticRepository(NHLStatsContext db)
 {
     _db = db;
 }