1. EF Core 概述

EF Core是什么

EF Core 是一个 O/RM(Object Relational Mapping)对象关系映射 框架,它也提供了对数据增删改查的基础封装,提供了Code First 的开发,它也有批量增删的功能扩展;

image-20200722102318847

EF特征

  • 支持多种数据库 MSSQL ,MySQL,SQLite,InMemory
  • 支持数据库的逆向工程,可以先建立模型也可以先建立数据库
  • 更改模型后可以使用迁移来更新数据库架构
  • 轻量级的, 开源的, 可扩展的,支持跨平台的
  • 使用简易,使用的人多,能够提高生产效率
  • 可以使用Linq
  • 注重领域,而不是数据库

EF Core VS EF6

相同点

  1. DBContext&DBSet
  2. Data Model
  3. Querying using Linq-to-Entities
  4. Change Tracking
  5. SaveChanges
  6. Migrations

EF6 独有 (表示怀疑)

  1. EDMX/ Graphical Visualization of Model
  2. Entity Data Model Wizard (for DB-First approach)
  3. ObjectContext API
  4. Querying using Entity SQL.
  5. Automated Migration
  6. Inheritance: Table per type (TPT)
  7. Inheritance: Table per concrete class (TPC)
  8. Many-to-Many without join entity
  9. Entity Splitting
  10. Spatial Data
  11. Lazy loading of related data
  12. Stored procedure mapping with DbContext for CUD operation
  13. Seed data 这个现在有了啊??
  14. Automatic migration

EF Core独有

  1. Easy relationship configuration 简易的关系配置
  2. Batch INSERT, UPDATE, and DELETE operations 批量操作
  3. In-memory provider for testing 不干扰测试数据库
  4. Support for IoC (Inversion of Control) 支持依赖控制
  5. Unique constraints 唯一键的约束
  6. Shadow properties 影子属性
  7. Alternate keys 备用键
  8. Global query filter 全局查询过滤
  9. Field mapping 字段映射
  10. DbContext pooling DbContext池
  11. Better patterns for handling disconnected entity graphs 更好的方式处理断开实体图

EF Core 学习网址

https://www.entityframeworktutorial.net/

https://docs.microsoft.com/zh-cn/ef/core/

posted @ 2020-07-22 10:26  maanshancss  阅读(1131)  评论(0编辑  收藏  举报