views:

34

answers:

1

Hi

I have an ef model and i want to "query" it using objectquery. So far i create my objectquery like this:

myQuery = new ObjectQuery<T>(mergeOption, context)

Is it possible to create an objectquery without the specifying the context right from the start (set it later on)? In my application i have multiple threads that needs to get the base query, extend and execute it.

A: 

Use a function, not a var:

protected ObjectQuery<T> myQuery(MyObjectContext context, MergeOption mergeOption)
{
     return new ObjectQuery<T>(mergeOption, context);
}
Craig Stuntz