You can do something like this:
public Product Get(int id, params Expression<Func<TEntity, object>>[] propertiesToInclude)
{
var query = context.Products;
foreach (var expression in propertiesToInclude)
{
query = query.Include(expression);
}
return query.SingleOrDefault(p => p.id == id);
}
The calling code could optionally specify the properties to be included using a lambda like so:
var justProduct = repo.Get(productId);
var productAndCategory = repo.Get(productId, p => p.Category);