missing db vscode api (#6266)
parent
88ec2d7c84
commit
cf25bdf210
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue