DataContext dc = new DataContext(connectionString);
        Table<Product> table = dc.GetTable<Product>();

        //价格大于5的记录条数
        int m = table.Count<Product>(p => p.UnitPrice > 5);
        //最大价格
        decimal pmax = table.Max<Product>(p => p.UnitPrice);
        //最小价格
        decimal pmin = table.Min<Product>(p => p.UnitPrice);
        //得到Id=5的产品
        Product product = table.Single<Product>(p => p.ProductID == 5);

相关文章:

  • 2022-02-24
  • 2021-11-26
  • 2021-12-22
  • 2022-12-23
猜你喜欢
  • 2021-10-09
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
  • 2022-01-04
  • 2022-12-23
相关资源
相似解决方案