Rich

Rich

  • NA
  • 84
  • 61.2k

Returning IQueryable

Jul 27 2012 4:36 AM

When using an entity framework model that  is in the same project as the code below, everything works fine:

IQueryable<sample1> GetSample1()

{

return db.sample1;

}

But when referencing an Entity Framework model from an external project I get this error:

Cannot implicityly convert type 'System.Data.Objects.ObjectSet<ExternalProject.sample1>' to 'System.Linq.IQueryable<CurrentProject.sample1>'. An explicit conversion exists (are you missing a cast?)

I am a little confused by this. Can someone explain to me why this is happening.


Answers (2)