Entity Framework Feature Suggestions

Make LINQ to Entities recognize GetValueOrDefault()

I have a LINQ query that involves a nullable integer. When I try to run the query, I get the following error:

"LINQ to Entities does not recognize the method 'Int32 GetValueOrDefault(Int32)' method, and this method cannot be translated into a store expression."

I am not a L2E or EF guru in the least, but it seems like that should translate to the SQL ISNULL function shouldn't it?

Regardless, can you please make this functionality work?

15 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Aaron BaumanAaron Bauman shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base