EF随机查询数据库表中数据

2022-08-13 10:32:53 码农 1039
DemoEntity model = dbcontext.Set<DemoEntity>().OrderBy(x => Guid.NewGuid()).Take(1).FirstOrDefault();

以上Take(1)中的数字表示随机查询几条数据。

—— 完 ——
  • 数据仓库中的元数据管理
  • Unity报错:error CS0246: The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?)
  • 2021年6月10日,第十三届全国人民代表大会常务委员会第二十九次会议表决通过了《中华人民共和国数据安全法》,该法律自 ( ) 起施行。
  • SQL BETWEEN运算符
  • 大厂也在用的6种数据脱敏方案
  • 数据库CPU占用100%优化过程
  • SQL 3NF第三范式
  • SQL分页查询的几种写法
  • SQL 2NF第二范式
  • MES数据采集系统需求分析和总体设计

© CopyRight 2014~2024 薄学网.