Is it possible to do this ?
public partial class NorthwindDataContext
{
public static Func<NorthwindDataContext, int, IQueryable<Product>>
ProductsByCategoryID = CompiledQuery.Compile
((NorthwindDataContext context, int categoryID) =>
context.Products.Where(p => p.CategoryID == categoryID));
public IQueryable<Product> GetProductsByCategoryIDFast(int categoryID)
{
return ProductsByCategoryID(this, categoryID);
}
}