Search for existing 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?

21 votes
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)

We’ll send you updates on this idea

Aaron Bauman shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

2 comments

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base