Based on this question ( error when using interfaces for Entity Framework (4.2) entities)
I'm trying to achieve persistence ignorance for read-only operations in the other layers of the application.
Using a very simple select these 3 work
var test = _newsSource.GetAll().ToArray();
var test2 = _newsSource.GetAll().Where(n => n.NewsID>0).ToArray();
var test3 = _newsSource.Find(n => n.ExpiryDate.HasValue).ToArray();
but a query following that involving joins fails. i've gone as far as using an interceptor to rewrite the expressions without any references to the interfaces. Then using The TypeChangeVisitor from another SO answer.
I also tried working VisitUnary to strip away unncessary cast/converts
This approach is failing on the simple tests saying my only variable is not bound.