EF Core in-memory Database Provider

Source: Internet
Author: User
Tags sqlite

Original link

This can is useful for testing, although the SQLite provider in In-memory mode is a more appropriate test rep Lacement for relational databases.

Supported Database Engines
    • Built-in In-memory database (designed for testing purposesonly)
Supported platforms
    • The. NET Framework (4.5.1 onwards)

    • . NET Core

    • Mono (4.2.0 onwards)

    • Universal Windows Platform

Testing with InMemory

The InMemory provider is useful when you want to test components using something, approximates connecting to the R EAL database, without the overhead of actual database operations.

InMemory is not a relational database

EF Core database providers do not has a to is relational databases. InMemory is designed to being a general purpose database for testing, and are not designed to mimic a relational database.

Some examples of this include:

    • InMemory'll allow you to save data, would violate referential integrity constraints in a relational databas E.

    • If You use the Defaultvaluesql (string) for a property in your model, the This is a relational database API and would have no EF Fect when running against InMemory.

For many test purposes these differences would not matter. However, if you want to test against something that behaves more like a true relational database and then consider using SQLite in-memory mode.

EF Core in-memory Database Provider

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.