Use Entity Framework Core In-Memory Database in ASP.NET Core
Most of the production cases call for storing data in some physical data store such as a SQL Server database. However, for testing and demoing purposes you may want to store data in memory rather than persistent store. That's where Entity Framework Core InMemory provider can be helpful. In this article we will examine the usage of the EF Core InMemory provider in an ASP.NET Core Razor Pages application.
http://www.binaryintellect.net/articles/5d51c9ac-9250-4a10-91c1-c8b4c70fcf87.aspx