Using the Northwind DB,
var pp = CompiledQuery.Compile ((TypedDataContext dc, decimal minUnitPrice) =>
from p in Products
where p.UnitPrice > minUnitPrice
orderby p.UnitPrice
select p
);
pp (this, 10).Dump ("Products with unit price > 10");
pp (this, 100).Dump ("Products with unit price > 100");
This is equivalent to the "normal" form:
var pp1 =
from p in Products
where p.UnitPrice > 10
orderby p.UnitPrice
select p;
pp1.Dump();
Enjoy!
No comments:
Post a Comment