Aspnetcore.docs: opt.UseInMemoryDatabase("TodoList") does not exist

Created on 9 Oct 2019  Â·  6Comments  Â·  Source: dotnet/AspNetCore.Docs

Hi there :wave: ! Beginner here, trying to follow the tutorial.

In "Register The Database Context" section, the method "UseInMemoryDatabase" does not seem to exist / can't be resolved. Did the method change, by any chance?

Ref https://docs.microsoft.com/en-ca/aspnet/core/tutorials/first-web-api?view=aspnetcore-3.0&tabs=visual-studio#register-the-database-context


Document details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

P4 Source - Docs.ms

Most helpful comment

Addition to Microsoft.EntityFrameworkCore.SqlServer you also need to install Microsoft.EntityFrameworkCore.InMemory Nuget package. It's missing in tutorial.

All 6 comments

Addition to Microsoft.EntityFrameworkCore.SqlServer you also need to install Microsoft.EntityFrameworkCore.InMemory Nuget package. It's missing in tutorial.

Thank you so much @kmkivist ! That made the trick. Hopefully that will be added to the tutorial!

That's in the instructions

Use the preceding instructions to add the Microsoft.EntityFrameworkCore.InMemory NuGet package.

dotnet new webapi -o TodoApi
cd TodoApi
dotnet add package Microsoft.EntityFrameworkCore.SqlServer
dotnet add package Microsoft.EntityFrameworkCore.InMemory
code -r ../TodoApi

@Rick-Anderson

Thank you for the reply! You are correct, it is in the instructions for Visual Studio Code.

However, it is missing from Visual Studio instructions (not Code). Is the recommended way to use Visual Studio Code instead?

It's not missing,
Use the preceding instructions to add the Microsoft.EntityFrameworkCore.InMemory NuGet package.

Oh, that's correct. My bad, I missed that line. Thank you for taking the care and sorry for that!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fabich picture fabich  Â·  3Comments

Rick-Anderson picture Rick-Anderson  Â·  3Comments

Mattacks picture Mattacks  Â·  3Comments

YeyoCoder picture YeyoCoder  Â·  3Comments

wgutierrezr picture wgutierrezr  Â·  3Comments