wire dbcontext to connection string

This commit is contained in:
Collin M. Barrett 2017-04-08 08:52:55 -05:00
parent 9dde67011d
commit 55f07fed08

View file

@ -6,6 +6,7 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using MySQL.Data.EntityFrameworkCore;
using MySQL.Data.EntityFrameworkCore.Extensions;
namespace FilterLists.API
{
@ -30,7 +31,7 @@ public void ConfigureServices(IServiceCollection services)
services.AddEntityFramework()
.AddEntityFrameworkMySQL()
.AddDbContext<FilterListsContext>(options =>
options.UseMySQL(ConnectionString));
options.UseMySQL(Configuration.GetConnectionString("FilterListsConnection")));
services.AddMvc();
}