i don't believe that hasvalue is recognized by linq to entities beause there is no way to convert that into sql. therefore i think in this case, l2e has to execute the query before it can evaluate hasvalue. i haven't seen this particular behavior before. i thk you need to find another way to express your nullability test. and i'd be interested to see the sql.
here's one interesting idea: http://social.msdn.microsoft.com/forums/en/csharplanguage/thread/56484ed7-9664-44f4-84a0-69da3901c817
there are all kind of weird behaviors with linq around nullables so you have to really pay attention to the results -> http://msdn.microsoft.com/en-us/library/bb738687.aspx
- EF does not lazy load Views
- The data source does not support server-side data paging
- Refactor Linq code and "LINQ to Entities does not recognize the method"
- Code does not seem to pass a certain line, causing StackOverflowException
- Task Does Not Contain a Definition for Where If Done in One Line of Code
- Does lazy loading load the entire collection upon iteration?
- Convert code that uses Linq to code that does not
- How to Lazy Load child object with string primary key in Entity Framework Code First?
- LINQ query does not load into data grid
- Why does my code not find directories
- Why this multi linq join code does not work?
- Why does LINQ with LazyLoading randomly NOT load children?
- LINQ to Entities does not recognize the method 'System.String ToString()' method, and this method cannot be translated into a store expression
- LINQ to Entities does not recognize the method
- LINQ to Entities does not recognize the method 'System.String Format(System.String, System.Object, System.Object)'
- System.Collections.Generic.List does not contain a definition for 'Select'
- LINQ: Select where object does not contain items from list
- LINQ to Entities does not recognize the method Int32 get_Item(Int32)
- Add items to a collection if the collection does NOT already contain it by comparing a property of the items?
- IQueryable<T> does not contain a definition for 'Include' and no extension method 'Include'
- Cannot initialize type '' with a collection initializer because it does not implement 'System.Collections.IEnumerable'
- What does this C# code with an "arrow" mean and how is it called?
- A specified Include path is not valid. The EntityType does not declare a navigation property with the name *
- System.Linq.IQueryable does not contain a definition for 'Where'
- Expression references a method that does not belong to the mocked object
- LINQ to Entities does not recognize the method 'System.TimeSpan Subtract(System.DateTime)' method
- EF 4: Removing child object from collection does not delete it - why?
- System.Linq.Dynamic does not support OrderByDescending("someColumn")?
- LINQ to Entities does not recognize the method 'System.DateTime GetValueOrDefault()'
- Why LINQ to Entities does not recognize the method 'System.String ToString()?
More Query from same tag
- Dynamic linq query not working
- Filter a Generic list using LINQ using a PropertyName as a string literal - Using dynamics
- C# How does the method OrderBy sorts objects by chars containing husky codes?
- svg to html using linq
- Grouping data by date ranges
- How to compare two datatables and only check for the rows found
- How can i fix this method using Linq so that the test (which should already work because the result is correct) works?
- create Expression tree in c# to select multiple records using LINQ.Expressions
- how to get running total by month
- Linq to Entity Framework return a list of parents with only a subset or empty collection of children
- Check the size of an array inside a list and show each entity in the array as a unique list value
- mongoDB run queries just like as SQL !
- Populating object properties from DataSet using LINQ
- LINQ to Entities - SQL “IN” clause and Group By
- GroupBy String and Count in LINQ
- How do I call Enumerable.Join from F#?
- Which LINQ Query is quicker? Sort or select last?
- query for jobject child with specific attribute value
- C# linq to json how to read a property value within a Array
- LINQ question with string split and arrays in csv files
- LINQ Order By Descending with Null Values on Bottom
- linq Select Collection Column Dynamic
- Simplest LINQ in C# troubleshooting
- How do I capture a variable in Linq method syntax?
- What does this mean in C# or LINQ? - ( () => )
- Handling null with dataset and LINQ
- C# web API linq to SQL List object
- Distinct IEqualityComparer<> problems
- What is the correct way of ignoring arguments in LINQ?
- Is it possible to handle exceptions within LINQ queries?