If you are using EFv4 + EDMX you can create custom model defined function which will do the CAST for you. You can then use that function in Linq-to-entities queries.
More Related Contents:
- LINQ to Entities does not recognize the method ‘System.String Format(System.String, System.Object, System.Object)’
- LEFT JOIN in LINQ to entities?
- Instantiating a context in LINQ to Entities
- EF 4: Removing child object from collection does not delete it – why?
- Linq To Entities – how to filter on child entities
- The specified type member ‘Date’ is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties
- Entity Framework 4 Single() vs First() vs FirstOrDefault()
- LINQ to Entities does not recognize the method
- How to create LINQ Expression Tree to select an anonymous type
- ‘Contains()’ workaround using Linq to Entities?
- What’s the difference(s) between .ToList(), .AsEnumerable(), AsQueryable()?
- Entity Framework: There is already an open DataReader associated with this Command
- Entity framework linq query Include() multiple children entities
- “A lambda expression with a statement body cannot be converted to an expression tree”
- The type of one of the expressions in the join clause is incorrect in Entity Framework
- Learning about LINQ [closed]
- How to compare only date components from DateTime in EF?
- “The LINQ expression node type ‘Invoke’ is not supported in LINQ to Entities” – stumped!
- Entity Framework – “Unable to create a constant value of type ‘Closure type’…” error
- How to create a dynamic LINQ join extension method
- conditional include in linq to entities?
- Use Entity framework I want to include only first children objects and not child of child(sub of sub)
- Linq to Entity Join table with multiple OR conditions
- Creating dynamic queries with entity framework
- ‘Date’ is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported
- Entity Framework, Code First and Full Text Search
- Calling a SQL User-defined function in a LINQ query
- Simple Linq query has duplicated join against same table?
- How to implement Unit of Work that works with EF and NHibernate
- How to avoid Query Plan re-compilation when using IEnumerable.Contains in Entity Framework LINQ queries?