When you create a WebApi project, registration database context in ConfigureServices, suggesting UseInMemoryDatabase method can not be found.
Open the "Tools -Nuget Package Manager - Package Manager Console", enter "Install-Package Microsoft.EntityFrameworkCore.InMemory", Enter.