EntityFramework 非常好用,结构优美.. 但是美中有不足:1.对动态查询条件支持的不是很好 ;2.批量操作支持的不是很好.。
下面就是几个第三方库,对EntityFramework 的扩展

一、第三方类库

LinqKit

动态拼装查询条件

开源地址:https://github.com/scottksmith95/LINQKit

Entity Framework Extensions

(收费)Website: http://entityframework-extensions.net/

Paid library to dramatically improve Entity Framework performance:

  • BulkSaveChanges
  • BulkInsert
  • BulkUpdate
  • BulkDelete
  • BulkMerge
  • BulkSynchronize

Entity Framework Plus

开源免费:https://github.com/zzzprojects/EntityFramework-Plus

Website: http://entityframework-plus.net/

Free & Open source library that support following features:

  • Audit
  • Batch Operations
    • Batch Delete
    • Batch Update
  • Query
    • Query Cache
    • Query Deferred
    • Query Filter
    • Query Future
    • Query IncludeFilter
    • Query IncludeOptimized

EFUtilities

1.功能包含单属性更新. 
2.Delete by query 
3.Batch insert entities 
4.Batch update entities 
5.Partial updates / Not loading the data from DB first 
6.Update by query 

如何使用看项目官网 
https://github.com/MikaelEliasson/EntityFramework.Utilities

代码获取方式如下:

支持EF4和5 
https://www.nuget.org/packages/EFUtilities/0.1.0

PM> Install-Package EFUtilities -Version 0.1. 

支持EF6 
https://www.nuget.org/packages/EFUtilities

PM> Install-Package EFUtilities 

EntityFramework.Extended

主要功能:批量更新和删除,缓存

//    Deleting

//delete all users where FirstName matches
context.Users
.Where(u => u.FirstName == "firstname")
.Delete(); // Update //update all tasks with status of 1 to status of 2
context.Tasks
.Where(t => t.StatusId == )
.Update(t => new Task { StatusId = }); //example of using an IQueryable as the filter for the update
var users = context.Users.Where(u => u.FirstName == "firstname");
context.Users.Update(users, u => new User {FirstName = "newfirstname"});

2015年后停止更新。迁移到Entity Framework Plus

开源地址: https://github.com/loresoft/EntityFramework.Extended

PM> Install-Package EntityFramework.Extended

efbulkinsert

批量插入 ,已迁移到Entity Framework Extensions
http://efbulkinsert.codeplex.com/

EF4
PM> Install-Package EntityFramework.BulkInsert-ef4
https://www.nuget.org/packages/EntityFramework.BulkInsert-ef4 EF5
PM> Install-Package EntityFramework.BulkInsert-ef5
https://www.nuget.org/packages/EntityFramework.BulkInsert-ef5 EF6
PM> Install-Package EntityFramework.BulkInsert-ef6
https://www.nuget.org/packages/EntityFramework.BulkInsert-ef6

内容来自 :

https://blog.csdn.net/phker/article/details/49334287

EF学习推荐文章:你必须知道的EF知识和经验

最新文章

  1. 第一个FPGA工程----点亮开发板上的3个LED灯
  2. C# Socket系列二 简单的创建 socket 通信
  3. 日常使用 Git 的 19 个建议[转]
  4. PAT乙级 1003. 我要通过!(20)
  5. 【面试题】Round A China New Grad Test 2014总结
  6. iOS sqlite3数据库解析
  7. [Ember] Creating Your First Ember.js Project with Ember-CLI
  8. leetcode Linked List Cycle python
  9. 采用proguard困惑android代码
  10. Android中检测软键盘的弹出和关闭
  11. 单片机裸机下写一个自己的shell调试器
  12. linux内核中的排序接口--sort函数
  13. react+mobx 编写 withStoreHistory 装饰器
  14. PAT 1135 Is It A Red-Black Tree[难]
  15. bzoj 1776
  16. pageResponse - 让H5适配移动设备全家
  17. No style sheet with given id found错误
  18. js之购物车案例
  19. iframe父页调子页和子页调父页方法
  20. codevs 3287 货车运输 NOIP2013提高组

热门文章

  1. Kafka技术内幕 读书笔记之(五) 协调者——协调者处理请求
  2. JAVA-try-catch-finally-自定义异常例子(适合初学者)
  3. layui(五)——form组件常见用法总结
  4. STM32学习笔记:【001】常见数据查阅
  5. 1.关于Java
  6. ffmpeg安装
  7. php实现无限级分类查询(递归、非递归)
  8. PHP文件系统管理
  9. class按传递时分析
  10. react ,ant Design UI中table组件合并单元格并展开详情的问题