Doesn’t Linq to SQL miss the point? Aren’t ORM-mappers (SubSonic, etc.) sub-optimal solutions?

Let me preface this by saying that I am a dyed-in-the-wool database guy. As a gross over-generalization: Developers don’t know SQL. Developers don’t really want to know SQL. They can write it, they can design tables, but it makes them feel icky. They tend to do stupid things when the necessary query is more than … Read more

How to convert DbSet in Entity framework to ObjectQuery

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 from DbContext. Requests – DbSet<Request> defined in Context class. objectSet – Can now be passed as ObjectQuery.

linq to entities vs linq to objects – are they the same?

That is definitely not the case. LINQ-to-Objects is a set of extension methods on IEnumerable<T> that allow you to perform in-memory query operations on arbitrary sequences of objects. The methods accept simple delegates when necessary. LINQ-to-Entities is a LINQ provider that has a set of extension methods on IQueryable<T>. The methods build up an expression … Read more