mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
minor updates
This commit is contained in:
parent
91e6c428de
commit
deb6810a9f
3 changed files with 30 additions and 1 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
19
api/FilterLists.Data/FilterListsContext.cs
Normal file
19
api/FilterLists.Data/FilterListsContext.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue