I am using CodeFirst approach and struck with an issue where I need to convert DbSet to ObjectQuery. This is what I did for conversion.
ObjectContext objectC
I found the answer. Of course, it is possible to convert DbSet in Entity framework to ObjectQuery using the below lines of code.
ObjectContext objectContext = ((IObjectContextAdapter)db).ObjectContext;
ObjectSet objectSet = objectContext.CreateObjectSet("Requests");
where,
db - Context class inherting from DbContext. Requests - DbSet defined in Context class. objectSet - Can now be passed as ObjectQuery.