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);

                }

            }

 

你可能感兴趣的:(execute)