原文链接

This can be useful for testing, although the SQLite provider in in-memory mode may be a more appropriate test replacement for relational databases.

Supported Database Engines

  • Built-in in-memory database (designed for testing purposes only)

Supported Platforms

  • .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 that approximates connecting to the real database, without the overhead of actual database operations.

InMemory is not a relational database

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

Some examples of this include:

  • InMemory will allow you to save data that would violate referential integrity constraints in a relational database.

  • If you use DefaultValueSql(string) for a property in your model, this is a relational database API and will have no effect when running against InMemory.

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

EF Core In-Memory Database Provider的更多相关文章

  1. ASP.NET Core 开发-Entity Framework (EF) Core 1.0 Database First

    ASP.NET Core 开发-Entity Framework Core 1.0 Database First,ASP.NET Core 1.0 EF Core操作数据库. Entity Frame ...

  2. ASP.NET Core 开发 - Entity Framework (EF) Core

    EF Core 1.0 Database First http://www.cnblogs.com/linezero/p/EFCoreDBFirst.html ASP.NET Core 开发 - En ...

  3. .Net Core+Angular6 学习 第四部分(EF Core(Code First))

    目的: 打算通过EF core 练习从database receive data 显示到UI. 1. 创建一个新的project Model.定义一个 base interface entity以及实 ...

  4. EF core 性能调优

    Entity Framework Core performance tuning – a worked example Last Updated: February 25, 2019 | Create ...

  5. SQLite EF Core Database Provider

    原文链接 This database provider allows Entity Framework Core to be used with SQLite. The provider is mai ...

  6. 一起学ASP.NET Core 2.0学习笔记(二): ef core2.0 及mysql provider 、Fluent API相关配置及迁移

    不得不说微软的技术迭代还是很快的,上了微软的船就得跟着她走下去,前文一起学ASP.NET Core 2.0学习笔记(一): CentOS下 .net core2 sdk nginx.superviso ...

  7. MySql Scaffolding an Existing Database in EF Core

    官方文档详见:https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework-core-scaffold-exampl ...

  8. 在EF Core里面如何使用以前EntityFramework的DbContext.Database.SqlQuery<SomeModel>自定义查询

    问: With Entity Framework Core removing dbData.Database.SqlQuery<SomeModel> I can't find a solu ...

  9. 记录在EF Core级联更新时出现的错误The database operation was expected to affect 1 row(s), but actually affected 0 row(s) (低级错误导致)

    错误提示:The database operation was expected to affect 1 row(s), but actually affected 0 row(s); data ma ...

随机推荐

  1. 20155228 2016-2017-2 《Java程序设计》第3周学习总结

    20155228 2016-2017-2 <Java程序设计>第3周学习总结 教材学习内容总结 认识对象 类与对象 类和对象的关系:类是对象的设计图,对象是类的实例 参考:将"名 ...

  2. 设计模式之模板方法模式:实现可扩展性设计(Java示例)

    概述 在实际开发中,常常会遇到一项基本功能需要支撑不同业务的情况.比如订单发货,有普通的整包发货,有分销单的发货,采购单的发货,有多商品的整包或拆包发货等.要想支持这些业务的发货,显然不能在一个通用流 ...

  3. 在hue中使用hive

    一.创建新表 建表语句如下: CREATE TABLE IF NOT EXISTS user_collection_9( user_id string , seller_id string , pro ...

  4. flask 使用宏渲染表单(包含错误信息)

    在模板中渲染表单时,有大量的工作: 1.调用字段属性,获取<input>定义 2.调用对应的label属性,获取<label>定义 3.渲染错误消息 为了避免为每一个字段重复这 ...

  5. 51Nod 1069 Nim游戏 (位运算)

    题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1069 有N堆石子.A B两个人轮流拿,A先拿.每次只能从一堆 ...

  6. 前端框架VUE----学习vue前的准备工作

    起步 1.扎实的HTML/CSS/Javascript基本功,这是前置条件. 2.不要用任何的构建项目工具,只用最简单的<script>,把教程里的例子模仿一遍,理解用法.不推荐上来就直接 ...

  7. IDEA之HttpServletRequest之报错解决方案

    @Controller public class UserController { @RequestMapping("/selectUser") public String sel ...

  8. js 实现几分钟前、几小时前、几天前,以及几分钟后、几小时后、几天前后

    js 实现几分钟前.几小时前.几天前,以及几分钟后.几小时后.几天前后 /* * * 把传入的时间戳与当前时间比较,计算几分钟前.几小时前.几天前,以及几分钟后.几小时后.几天前后 * unixtim ...

  9. Centos部署flask项目

    必备: Python2.7(ok) MySQL(ok) git supervisor virtualenv Gunicorn 阿里云服务器(最便宜的就好) 域名(国内万网,国外goDaddy) 我的P ...

  10. 【题解】Luogu CF1051F The Shortest Statement

    原题传送门:CF1051F The Shortest Statement 题目大意,给你一个稀疏图,q次查询,查询两点之间距离 边数减点小于等于20 这不是弱智题吗,23forever dalao又开 ...