示例#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, TAMServiceContext dbContext)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }

            dbContext.Database.Migrate();
            app.UseCors("AllowAny");
            app.UseSwagger();
            app.UseHttpsRedirection();
            app.UseSwaggerUI(x => { x.SwaggerEndpoint("/swagger/v1/swagger.json", "TAM V1.0"); });

            app.UseRouting();
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
 public App(TAMServiceContext dbContext, IDataStore dataStore)
 {
     _dbContext = dbContext;
     _dataStore = dataStore;
 }
示例#3
0
 public SqlDataStore(TAMServiceContext coreServiceContext)
 {
     _context = coreServiceContext;
 }