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