随笔分类 -  Entity Framework

Entity Framework6
摘要:SQL:SELECT [t0].[ProductName], [t1].[TotalPrice] AS [TotalPrice]FROM [Product] AS [t0]LEFT OUTER JOIN [OrderDetail] AS [t1] ON [t0].[ProductID] = [t1]... 阅读全文
posted @ 2015-07-02 19:57 dldg 阅读(538) 评论(0) 推荐(0)
摘要:The specified LINQ expression contains references to queries that are associated with different cont。解决方法:查询源的最后添加.ToList();一定是哪里转换成了IEnumerable或其他东东了... 阅读全文
posted @ 2015-06-03 10:41 dldg 阅读(1376) 评论(0) 推荐(0)
摘要:在EF中,我们建立数据模型的时候,可以给属性配置数据生成选项DatabaseGenerated,它后有三个枚举值:Identity、None和Computed。Identity:自增长None:不处理Computed:表示这一列是计算列。在EF中,如果主键是int类型,Code First生成数据库... 阅读全文
posted @ 2014-12-29 09:53 dldg 阅读(561) 评论(0) 推荐(0)