missing db vscode api (#6266)

pull/6274/head
user135711 2018-05-08 05:12:42 -07:00 committed by Scott Addie
parent 88ec2d7c84
commit cf25bdf210
2 changed files with 9 additions and 0 deletions

View File

@ -3,6 +3,8 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using TodoApi.Models;
using Microsoft.EntityFrameworkCore;
namespace TodoApi
{
@ -18,6 +20,8 @@ namespace TodoApi
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<TodoContext>(opt =>
opt.UseInMemoryDatabase("TodoList"));
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}

View File

@ -4,6 +4,9 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using TodoApi.Models;
using Microsoft.EntityFrameworkCore;
namespace TodoApi
{
@ -18,6 +21,8 @@ namespace TodoApi
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<TodoContext>(opt =>
opt.UseInMemoryDatabase("TodoList"));
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}