minor updates

This commit is contained in:
Collin M. Barrett 2017-04-08 08:38:58 -05:00
parent 91e6c428de
commit deb6810a9f
3 changed files with 30 additions and 1 deletions

View file

@ -17,5 +17,8 @@
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FilterLists.Data\FilterLists.Data.csproj" />
</ItemGroup>
</Project>

View file

@ -1,8 +1,11 @@
using Microsoft.AspNetCore.Builder;
using FilterLists.Data;
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;
namespace FilterLists.API
{
@ -24,6 +27,10 @@ public Startup(IHostingEnvironment env)
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddEntityFramework()
.AddEntityFrameworkMySQL()
.AddDbContext<FilterListsContext>(options =>
options.UseMySQL(ConnectionString));
services.AddMvc();
}

View file

@ -0,0 +1,19 @@
using FilterLists.Models;
using Microsoft.EntityFrameworkCore;
namespace FilterLists.Data
{
public class FilterListsContext : DbContext
{
public FilterListsContext(DbContextOptions options)
: base(options)
{
}
public FilterListsContext()
{
}
public DbSet<List> Lists { get; set; }
}
}