用Gateway那个方法可以实现?求表一字段的最小值.

0 views
Skip to first unread message

小鱼儿

unread,
Dec 4, 2006, 2:58:27 AM12/4/06
to NBear Google Group
用Gateway那个方法可以实现?求表一字段的最小值.
比如我想求商品表商品的最低价格.
public interface Product
{
[PrimaryKey]
int Id
{
get;
}
int price
{
get;
set;
}
string Name
{
get;
set;
}

}
查寻返回一个Product

Teddy

unread,
Dec 4, 2006, 3:05:23 AM12/4/06
to nbear...@googlegroups.com
可以先用object minPrice = Gateway.Min<Product>(WhereClip.All, Product._.price)获得最小的价格,再用Gateway.Find<Product>(Product._.price == minPrice);得到这个Product。

Teddy
 
Reply all
Reply to author
Forward
0 new messages