예제 #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)
        {
            DocumentDbInitializer.Initialize(Configuration);
            app.UseCors("CorsPolicy");
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseSwagger();
            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "AES API v1.0");
            });

            var option = new RewriteOptions();

            option.AddRedirect("^$", "swagger");
            app.UseRewriter(option);
            app.UseSignalR(routes =>
            {
                routes.MapHub <AesHub>("/aesHub");
            });
            app.UseMvc();
        }
예제 #2
0
        public async Task <ActionResult> InitDocumentDb()
        {
            string json;

            using (var fs = new FileStream(this.Server.MapPath("~/Content/Startup/seed.json"), FileMode.Open))
            {
                using (var sr = new StreamReader(fs))
                {
                    json = sr.ReadToEnd();
                }
            }

            var status = await DocumentDbInitializer <SeedModel> .Initialize(json);

            if (this.Request.IsAjaxRequest())
            {
                return(this.PartialView("_List", this.GetAll()));
            }

            return(this.View("InitStatus", status));
        }
예제 #3
0
 public void Execute()
 {
     var result = DocumentDbInitializer <Tenant> .Initialize(this.Json, DefaultCollection, DefaultDatabase).Result;
 }