1

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.

Community
  • 1
  • 1
Maslow
  • 18,464
  • 20
  • 106
  • 193
  • The question isn't every clear. I assume your GetAll() is reutnring an IQueryable. Can you post your attempting Join that is failing? There is nothing about simply joining some data that should require any of the complex things you've already tried. – Honorable Chow Jul 23 '13 at 17:37

0 Answers0