Is it possible to call a StoredProcedure from an ObjectQuery? Basically I want to dynamically build a query and execute it server-side. You can imagine each query to be part of a search where you can combine different criteria with "and" or "or". It is working fine with ObjectQueries created like this.
var query1 = from a in objectContext.Articles
where a.Name = 'SOMETHING'
select new ResultType { ArticleId = a.ArticleId, Name = a.Name };
var query2 = from a in objectContext.Articles
where a.Name = 'SOMETHING ELSE'
select new ResultType { ArticleId = a.ArticleId, Name = a.Name };
query1 = query1.Intersect(query2); // or union depending on what we need
// ... and more queries
var something = query1.ToList(); // query execution...
So how I can get this working with a stored procedure call. The problem is that the call to ExecuteFunction will return an ObjectResult.