score:3
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
hth julie
Source: stackoverflow.com
Related Articles
- EF does not lazy load Views
- Does lazy loading load the entire collection upon iteration?
- How to Lazy Load child object with string primary key in Entity Framework Code First?
- The data source does not support server-side data paging
- What does this C# code with an "arrow" mean and how is it called?
- Why is my code doing lazy loading even after I turned it off at every possible point?
- Does this LINQ code perform multiple lookups on the original data?
- Does LINQ with a scalar result trigger the lazy loading
- Does this code really cause an "access to modified closure" problem?
- Does Queryability and Lazy Loading in C# blur the lines of Data Access vs Business Logic?
- How does linq actually execute the code to retrieve data from the data source?
- LINQ Source Code Available
- How does this linq code that splits a sequence work?
- Refactor Linq code and "LINQ to Entities does not recognize the method"
- .NET 4 Code Contracts: "requires unproven: source != null"
- Does First() in LINQ cause eager or lazy loading?
- How to lazy load a where condition using LINQ
- Does LINQ load every object in a request?
- What does the code query.Take(() => 1) do?
- creating Linq to sqlite dbml from DbLinq source code
- Does LINQ convert code to SQL queries
- Does LINQ load all items from SQL Server into memory or chunks only?
- Does a DomainService load all entities before executing linq?
- why does this linq code get exponentially slower when applying First() to projection?
- How eager does LINQ and Entity Framework load by default?
- Entity Framework lazy load
- Does a code that combines single() with yield make any sense?
- what does this .net line of code means
- How does VS Code metrics do the math
- how to recursive load n children in comment table when lazy loading and proxies is false?
- XDocument System.UriFormatException: 'Invalid URI: The Uri string is too long
- How to transfer items of one static list to another
- Add XElement in another XElement in specific location
- How do I find whether a filtered BindingSource contains an item from the underlying DataSet?
- XML LINQ: How to use select with where?
- LINQ query IN for array
- Populating a List(Of String) from a Datatable using LINQ in VB.NET
- Strange syntax in ef
- custom sort using linq based on Ranks
- Get a count of items with a certain condition within a StackPanel's Children
- What is the purpose of AsQueryable()?
- GroupBy then Take in LINQ to Entities?
- GROUP BY, ORDER BY and taking first in LINQ
- server side operation only return data to grid for particular page
- Getting Function Evaluation Timedout error when using function inside linq query
- How can I allow user to sort columns on a LINQ-to-SQL WPF Datagrid?
- C# linq totalization
- Linq Expression tree Any() issue
- Why isn't .Except (LINQ) comparing things properly? (using IEquatable)
- the best overloaded method match for List<T>.Add(T) has some Invalid arguments