ExecuteStoreQuery

  using (var webdb = new kyj_NewHouseDBEntities())
            {
                string sql = "select * from developer where loginname='liyuzhao'; select 4 as Id;select 3;UPDATE dbo.Developer SET Telephone='123' WHERE LoginName='liyuzhao'";
                var result = webdb.ExecuteStoreQuery<Developer>(sql, null);//返回第一个查询集合,返回的数据集的列要和实体对应
                var vv = result.Where(m => m.Id > 0);
                foreach (var v in vv)
                {
                    Console.WriteLine(v.ProvinceId);
                }
            }

 

posted @ 2014-05-21 10:08  Rookier  阅读(385)  评论(0编辑  收藏  举报