加入EntityFramework.Extended到项目 [英] Adding EntityFramework.Extended to the project
本文介绍了加入EntityFramework.Extended到项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经添加了 EntityFramework.Extended
(链接)到我的项目中使用的NuGet。
现在我面临一个单一的问题;我该如何使用它与我的的DbContext
?
I've added EntityFramework.Extended
(link) to my project using NuGet.
Now I'm facing one single problem; how can I use it's Update
function with my dbContext
?
推荐答案
导入命名空间使用EntityFramework.Extensions
,并使用更新
(从样本Update方法说明):
Import namespace using EntityFramework.Extensions
and use Update
(sample from Update method description):
dbContext.Users.Update(
u => u.Email.EndsWith(emailDomain),
u => new User { IsApproved = false, LastActivityDate = DateTime.Now });
这篇关于加入EntityFramework.Extended到项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文