Is there an in-memory provider for Entity Framework?

前端 未结 8 2333
情书的邮戳
情书的邮戳 2020-12-05 22:42

I am unit testing code written against the ADO .NET Entity Framework. I would like to populate an in-memory database with rows, and make sure that my code retrieves them pro

8条回答
  •  感动是毒
    2020-12-05 23:07

    In EF Core there are two main options for doing this:

    1. SQLite in-memory mode allows you to write efficient tests against a provider that behaves like a relational database.
    2. The InMemory provider is a lightweight provider that has minimal dependencies, but does not always behave like a relational database

    I am using SQLite and it supports all queries, that I need to do with Azure SQL production database.

提交回复
热议问题