日期:2014-05-20 浏览次数:20781 次
DateTime dt1 = DateTime.Now;
for (int i = 0; i < 10000; i++)
{
var lstSku = (from sku in dataContext.SKU
join skuinfo in dataContext.SKUInfo on sku.Id equals skuinfo.SKUID
where sku.Uid == 2 && skuinfo.LID == 1
select new { skuid = sku.Id, sku = sku.SKU1, info = skuinfo.Title }).Skip(5).Take(2);
}
TimeSpan ts1 = DateTime.Now - dt1;
DateTime dt2 = DateTime.Now;
var query = CompiledQuery.Compile((DataClasses1DataContext dataContextTest) => (from sku in dataContextTest.SKU
join skuinfo in dataContextTest.SKUInfo on sku.Id equals skuinfo.SKUID
where sku.Uid == 2 && skuinfo.LID == 1
select new { skuid = sku.Id, sku = sku.SKU1, info = skuinfo.Title }).Skip(5).Take(2));