예제 #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, TrulliContext db)
        {
            if (env.IsDevelopment())
            {
                app.UsePlayground();

                // Blocking
                //app.ApplicationServices.GetRequiredService<MongoDbWatch>().Watch();

                // Non-blocking
                //Task.Run(() => { app.ApplicationServices.GetRequiredService<IMongoDbWatch>().Watch(); });
            }

            app.UseCors();

            //preload db
            db.EnsureSeedData();

            app.UseWebSockets();

            app.UseRouting();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapGraphQL();
            });
        }
예제 #2
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, TrulliContext db)
        {
            if (env.IsDevelopment())
            {
                app.UsePlayground();
            }

            //preload db
            db.EnsureSeedData();

            app.UseWebSockets();

            app.UseRouting();

            // routing area
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapGraphQL();
            });
        }
 public TrulloRepository(TrulliContext db)
 {
     _db = db;
 }
 public PropertyRepository(TrulliContext db)
 {
     _db = db;
 }