score:3
Accepted answer
EF does not recognize the implicit conversion from Nullable<T>
to object
, which the compiler generates for the .Equals()
call.
Change that to the ==
operator and you should be fine, because the spec defines an equality operator between T
and Nullable<T>
.
Source: stackoverflow.com
Related Query
- LINQ to Entities only supports casting EDM primitive or enumeration types error
- SqlServer 2005 Ok, MSLocalDb 2016 Error : LINQ to Entities only supports casting EDM primitive or enumeration types
- Unable to cast the type X to type Y. LINQ to Entities only supports casting EDM primitive or enumeration types
- Unable to cast the type 'DynamicClass1' to type <T>. LINQ to Entities only supports casting EDM primitive or enumeration types
- Unable to cast the type 'x' to type 'y'. LINQ to Entities only supports casting EDM primitive or enumeration types
- Unable to cast System.Double to System.Object. LINQ to Entities only supports casting EDM primitive or enumeration types
- Unable to cast the type 'System.Int32' to type'System.Object'. LINQ to Entities only supports casting EDM primitive or enumeration types
- Unable to cast the type 'Anonymous type' to type 'Transcriber.Models.Jobs'. LINQ to Entities only supports casting EDM primitive or enumeration types
- Unable to cast the type 'Shared.ClientService' to type 'Shared.IClientID'. LINQ to Entities only supports casting EDM primitive or enumeration types
- LINQ to Entities only supports casting EDM primitive or enumeration types - How to fix without ToList() call
- LINQ to Entities only supports casting EDM primitive or enumeration types. (interface)
- Unable to cast the type 'System.Int32' to type 'System.Object'. LINQ to Entities only supports casting Entity Data Model primitive types
- LINQ to Entities only supports casting Entity Data Model primitive types?
- Linq To Entities 'Only primitive types or enumeration types are supported' Error
- Entity Framework Linq Query to List - Error when using contains: Only primitive types, enumeration types and entity types are supported
- Expression... LINQ to Entities only supports casting Entity Data Model primitive types”
- LINQ related error "Unable to create a constant value of type 'System.Object'. Only primitive types or enumeration types are supported in this context
- Linq update error Only primitive types or enumeration types are supported in this context
- C# - Linq : Unable to create a constant value of type Only primitive types or enumeration types are supported in this context.
- LINQ query. Only primitive types or enumeration types are supported in this context
- Linq Multiple join to 'Only primitive types or enumeration types are supported' Error
- LINQ Query error: Unable to create a constant value of type. Only primitive types or enumeration types are supported in this context
- Unable to create a constant value of type ''. Only primitive types or enumeration types are supported in this context. ASP.NET MVC LINQ EF
- Linq receiving unable to create value type of model, only primitive types or enumeration types are supported
- Linq to Entities: Only primitive types or enumeration types are supported in this context
- Unable to create a constant value of type 'Anonymous type'. Only primitive types or enumeration types are supported in this context two db Linq query
- Linq with expect: Only primitive types or enumeration types are supported in this context
- Linq Any - Only primitive types or enumeration types are supported in this context
- Only primitive types or enumeration types are supported in this context- linq join
- Only primitive types or enumeration types are supported in this context in linq
More Query from same tag
- Convert Sql Query of Last 50 minutes record into Linq Query
- ASP.NET MVC and Linq, when to use?
- how to edit particular item in linq to xml
- Log Queries executed by Entity Framework DbContext
- linq query 'orderby' using multiple fields at SQLite plugin by MvvmCross doesn't work
- Merging lists in another list using LINQ c#
- Linq query that tests for existence in multiple lists
- Unable to cast object of type in below Linq method
- Enforce ordering of OData items even when $top is used
- How to negate a delegate?
- Using Row_Number in Linq where clause
- extract data from JSON string with LINQ request
- LINQ expression: Specifing maximum groupby size
- XML linq need detail info on exception
- Modifying existing generic repository pattern to add select
- EF ExecuteStoreQuery with unknown type
- Linq Custom Sorting
- LINQ: latest sum of data within data range
- Lambda expression to find greatest among 3 numbers
- How to store a value and its list of stings in a list
- Entity Framework (4.0) how to exclude a related table
- Combined to date and time fields into one when both datetime stamps
- Point in polygon OR point on polygon using LINQ
- Converting a 2 Argument Expression into a 1 Argument Expression
- How to only return a list of inherited instances if defined, otherwise return the base class
- Linq Join by ids and sort by name
- Linq - OfType<> not working as expected
- Iterate through Linq to Entities results until condition is met
- Complex linq with Entity Framework query
- Narrowing a result set using LINQ