zzz projects Entity Framework 6 EF 6
Home EF Core Articles Knowledge Base Online Examples
  • Home
  • EF Core
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework 6 - Knowledge Base (KB)

7 results in tag: casting

Cast IQueryable<EntityObject> to IQueryable<Specific>

We are trying to cast an instance of ...IQueryable<EntityObject>... to an ...IQueryable<SpecificEntityObject>..., the ...SpecificEntityObject... type is only known at runtime....We have tried using the code below, which does not compile because The type o...
c# casting entity-framework iqueryable linq
asked by Stuart.Sklinar

Integer Contains Using Linq

I'm having some difficulty writing a linq query that will check whether the consecutive digits in an integer are contained in the primary key of a table. So, suppose there is a table called ...Employees... with a primary key on the column ...Employees.Id...
c# casting entity-framework linq
asked by Andrew

DbSet.Cast<TEntity>() Error: Cannot create a DbSet<IEntity> from a non-generic DbSet for objects of type 'Entity'

Version Info:...I am using C# 4.5, Entity Framework 6.0, and MEF....Code and Unit Test...I created a Test Project to explain the problem: ...https://skydrive.live.com/redir?resid=E3C97EC293A34048!2234...Please Open the UnitTest project and try to run Test...
c# casting dbset entity-framework mef
asked by Aidin

Cast() exception: LINQ to Entities only supports casting EDM primitive or enumeration types

I want to display some entity named ...CriminalEvent... in a general-purpose MVC view I wrote. The view requires that the Model pass to it shall implement the ...IDataModel... interface. Now, ...CriminalEvent... has the properties to implement this interf...
asp.net-mvc c# casting entity-framework linq-to-entities
asked by user1707621

Casting errors when attempting to return an IQueryable<MyType>

I have a query that ought to return an ...IQueryable<MyType>.... The code looks like this:...public IQueryable<MyType> GetFooList() { var query = (from x in dbContext.TableX join y in dbContext.TableY on x.our_id equals y.our_id ...
asp.net-mvc c# casting entity-framework linq
asked by Codes with Hammer

How to cast DbSet<T> to List<T>

Given the following simplified Entity Framework 6 context, I am trying to populate a List with the entities but having problems with how to cast (I believe) via reflection....public class FooContext : DbContext { public virtual IDbSet<FooClass> Foo { g...
c# casting entity-framework-6 reflection
asked by Kyle

Is there a way to cast in the `Where` part of an Entity Framework query?

To be clear, I am not referring to performing a ....Cast<T>... on the results of an EF call....I'm trying to implement a partial search on a number field....When creating a SQL script, it is easy to convert a column to another data type:...SELECT Id FROM ...
c# casting entity-framework entity-framework-6 linq
asked by krillgar

Page 1 of 1
  • 1

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Save your entities 20× faster with EF Extensions
SaveChanges vs BulkSaveChanges

EF Extensions
Try for free now
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!