上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页
摘要: 延迟加载:延迟加载相关的数据 首先查询Student表 再查询StudentAddress表 可以为指定的属性或整个上下文关闭延迟加载的功能,关闭属性的延迟加载功能就是不要设置属性为virtual 延迟加载的规则: 1.context.Configuration.ProxyCreationEnabl 阅读全文
posted @ 2017-03-26 16:01 蓝平凡 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 延迟加载:延迟加载相关的数据 首先查询Student表 再查询StudentAddress表 可以为指定的属性或整个上下文关闭延迟加载的功能,关闭属性的延迟加载功能就是不要设置属性为virtual 延迟加载的规则: 1.context.Configuration.ProxyCreationEnabl 阅读全文
posted @ 2017-03-26 15:59 蓝平凡 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 贪婪加载是指查询一个类型实体的时候同时查询与实体关联的类型 通过Include()方法实现 Load multiple levels of related entities: 阅读全文
posted @ 2017-03-26 15:53 蓝平凡 阅读(434) 评论(0) 推荐(0) 编辑
摘要: DBSet的Local属性提供简单的从context上下文获取当前已经被跟踪的实体(实体不能被标记为Deleted状态) 上面的例子中表明,本地数据保持跟踪状态为Added,Modified,Unchanged状态的实体 DBSet集合跟踪状态为Deleted,Modified,Unchanged实 阅读全文
posted @ 2017-03-26 15:26 蓝平凡 阅读(479) 评论(0) 推荐(0) 编辑
摘要: USE [SchoolDB] GO /****** Object: UserDefinedFunction [dbo].[GetCourseListByStudentID] */ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE FUNCTION [dbo].[GetCo... 阅读全文
posted @ 2017-03-26 15:02 蓝平凡 阅读(310) 评论(0) 推荐(0) 编辑
摘要: MS SQl Server引进两种特殊的数据类型geography and geometry 阅读全文
posted @ 2017-03-26 14:53 蓝平凡 阅读(313) 评论(0) 推荐(0) 编辑
摘要: 1. Convert an existing property to Enum: 2. Add New Enum from Designer: 3. If you already have Enum type created in your code, then you can use that a 阅读全文
posted @ 2017-03-26 12:54 蓝平凡 阅读(288) 评论(0) 推荐(0) 编辑
摘要: To migrate your existing Entity Framework 4.x project to Entity Framework 5.0 using VS2012, first target .NET Framework 4.5: Second, remove the existi 阅读全文
posted @ 2017-03-26 12:43 蓝平凡 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 我们先创建如下3个存储过程 1.Sp_InsertStudentInfo: 2.sp_UpdateStudent: 3.sp_DeleteStudent 将存储过程添加到EDM中 实体浏览器将存储过程添加到存储模型中,但是不引进函数 在EDM设计器中,右键Student实体,选择存储过程映射 上面代 阅读全文
posted @ 2017-03-26 12:39 蓝平凡 阅读(302) 评论(0) 推荐(0) 编辑
摘要: CREATE PROCEDURE [dbo].[GetCoursesByStudentId] -- Add the parameters for the stored procedure here @StudentId int = null AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from... 阅读全文
posted @ 2017-03-25 23:16 蓝平凡 阅读(261) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页