mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
remove duplicate
This commit is contained in:
parent
a7ceb60265
commit
b724e287d6
1 changed files with 0 additions and 49 deletions
|
|
@ -1,49 +0,0 @@
|
|||
using FilterLists.Data.Contexts;
|
||||
using FilterLists.Services;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using MySQL.Data.EntityFrameworkCore;
|
||||
using MySQL.Data.EntityFrameworkCore.Extensions;
|
||||
|
||||
namespace FilterLists.Api
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public Startup(IHostingEnvironment env)
|
||||
{
|
||||
var builder = new ConfigurationBuilder()
|
||||
.SetBasePath(env.ContentRootPath)
|
||||
.AddJsonFile("appsettings.json", false, true)
|
||||
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", true)
|
||||
.AddEnvironmentVariables();
|
||||
Configuration = builder.Build();
|
||||
}
|
||||
|
||||
public IConfigurationRoot Configuration { get; }
|
||||
|
||||
// This method gets called by the runtime. Use this method to add services to the container.
|
||||
public void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
// Add framework services.
|
||||
services.AddEntityFramework()
|
||||
.AddEntityFrameworkMySQL()
|
||||
.AddDbContext<FilterListsDbContext>(options =>
|
||||
options.UseMySQL(Configuration.GetConnectionString("FilterListsConnection")));
|
||||
services.AddMvc();
|
||||
services.AddTransient<IListService, ListService>();
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
|
||||
{
|
||||
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
|
||||
loggerFactory.AddDebug();
|
||||
|
||||
app.UseMvc();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue