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<Request> objectSet = objectContext.CreateObjectSet<Request>("Requests");
where,
db
– Context class inherting fromDbContext
.Requests
–DbSet<Request>
defined in Context class.objectSet
– Can now be passed asObjectQuery
.