一、查询实体类

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

 

相关文章:

  • 2021-09-06
  • 2021-09-07
  • 2021-08-19
  • 2021-11-16
  • 2022-12-23
  • 2021-11-22
  • 2021-06-21
猜你喜欢
  • 2022-02-22
  • 2021-06-04
  • 2021-09-12
  • 2022-12-23
  • 2021-11-09
  • 2021-11-03
相关资源
相似解决方案