Linq to Entities: cannot be translated into a store expression

Posted by FM250 on Stack Overflow See other posts from Stack Overflow or by FM250
Published on 2010-06-10T22:52:46Z Indexed on 2010/06/10 23:02 UTC
Read the original article Hit count: 132

Filed under:

I am trying to execute this query, but I am getting an error: cannot be translated into a store expression.

If I can't do it this way how can I implement it? I am using C#.

I am trying to display training records if the date taken is not this year. Any suggestion is highly appreciated.

tr =  from l in t.Trainees
      where !db.UserTrainings.Any(ut => ut.Trainees.TraineeId == l.TraineeId &&
                                        ut.Passed == true &&
                                        ut.DateTaken >= l.DateEnded.Value.AddYears(-1)) 
      ...... rest of the query.

© Stack Overflow or respective owner

Related posts about c#