02 2014 档案

摘要:1 直接使用表对应的实例属性值 ,如本例中的RoleUserInfo的属性UserInfo IEnumerable roleUserInfos= db.RoleUserInfoes.Where(p => p.Role_ID == roleID).AsEnumerable (); return from u in roleUserInfos select new UserInfo { ID = u.UserInfo.ID, PWD = u.UserInfo.PWD, UName = u.UserInfo.UName };2自己写个存储过... 阅读全文
posted @ 2014-02-18 21:19 被爱浸润的智慧体 阅读(1741) 评论(0) 推荐(0)
摘要:#1 Func与 Expression>的区别Func本身就是一个委托(delegate),而Expression>确实一个表达式,只有在编译之后才会变成委托,那么在EF中到底使用哪一个呢?又是为什么呢?其实如果我们写成Func类型的便来那个如果作为参数传递给where方法进行Linq查询时,Entity FrameWork将会产生全表查询,将整个数据库表忠的数据加载到内存中,然后再内存中根据where中的条件进一步查询,而Expression>只是查询出来你where条件中的数据,不用去进行全表查询#2 iqueryable与ienumerable的区别EF的DbSet属性 阅读全文
posted @ 2014-02-14 14:45 被爱浸润的智慧体 阅读(4847) 评论(0) 推荐(0)
摘要:1、运行程序时提示 ,vension does not match. 差不多是这样一个提示,具体怎么样的给忘记了。#1remove 'entity framework' from reference#2update the app.config to 6.0.0#3use Nuget to install Entity Framework: install-package entityframework sometimes ,the Nuget prompts :the project has already installed entity framework. now yo 阅读全文
posted @ 2014-02-14 09:27 被爱浸润的智慧体 阅读(1834) 评论(0) 推荐(0)