Я нашел решение с помощью DataObjects.NET
var query =
from product in Query.All<Product>()
where product.ProductName.Contains("a")
select new {Product = product, FakeKey = 0} into i
group i.Product.UnitPrice by i.FakeKey into g
select new { Count = g.Count(), Price = g.Sum() };
var result = query.AsEnumerable().Single();
SQL:
SELECT Count_big(*) AS [column1],
SUM([a].[UnitPrice]) AS [column2]
FROM (SELECT [b].[ProductId],
[b].[TypeId],
[b].[ProductName],
[b].[Seller],
[b].[Category.Id],
[b].[ProductType],
[b].[UnitPrice],
[b].[UnitsInStock],
[b].[UnitsOnOrder],
[b].[ReorderLevel],
[b].[QuantityPerUnit],
0 AS [column]
FROM [dbo].[Products] [b]
WHERE ( [b].[ProductName] LIKE '%a%' )) [a]
GROUP BY [a].[column];