Hello Alireza,
Sounds like if making a simple change to the DbQueryVisitor enables this scenario you should go ahead and send the pull request. We will consider it for the next release after EF6. Another thing I would like to encourage you to consider is how make a scenario like yours easier to solve for everybody. For example, we have been talking quite a bit within the EF team about creating a Query API on DbContext that accepts any Expression<Func<T>> and can return a T (and async version, QueryAsync would return a Task<T>). Not sure if this exactly would help in what you are trying to do, but perhaps it is worth keeping in mind.
Thanks,
Diego
Sounds like if making a simple change to the DbQueryVisitor enables this scenario you should go ahead and send the pull request. We will consider it for the next release after EF6. Another thing I would like to encourage you to consider is how make a scenario like yours easier to solve for everybody. For example, we have been talking quite a bit within the EF team about creating a Query API on DbContext that accepts any Expression<Func<T>> and can return a T (and async version, QueryAsync would return a Task<T>). Not sure if this exactly would help in what you are trying to do, but perhaps it is worth keeping in mind.
Thanks,
Diego