wiseant

2011年7月14日

Entity Framework 4.1 DbContext对T-SQL的支持

摘要: 一、查询实体类 ctx.Users.SqlQuery("select * from dbo.Users").ToList();二、查询单个字段 ctx.Database.SqlQuery<string>("select Name from dbo.Users").ToList();三、使用T-SQL更新数据 ctx.Database.ExecuteSqlCommand( "update dbo.Users set Age=20 where UserId=100"); 阅读全文

posted @ 2011-07-14 15:32 Ant 阅读(459) 评论(0) 推荐(0) 编辑

Entity Framework 4.1 DbContext环境中使用ESQL查询数据

摘要: ((IObjectContextAdapter)ctx).ObjectContext.CreateQuery<EntityClass>(eSql); 阅读全文

posted @ 2011-07-14 14:53 Ant 阅读(371) 评论(0) 推荐(0) 编辑

导航