Can Entity Framework do what Linq To SQL does?

I am a little confused, I was working with Linq To SQL and going, we can query anything in dbml or entity like:

var query = from i in db.mytable
            select i;

      

But in Entity Framework (presumably Microsoft is replacing Linq To SQL), how can we do the same? Is it possible? How to replace Linq with SQL?

Would be grateful for any examples of Entity Framework framework - as it is done in Entity Framework! Thank.

+2


source to share


2 answers


The same as what you want to write

var query = from i in db.mytable
            select i;

      



I think you didn't create the object (db) correctly for Entity Framework

LINQ To SQL Vs. Entity Framework

+2


source


Yes, more or less the same - you have Linq-to-Entities that should definitely support this simple LINQ query.

The Entity Framework is more than just a bloated Linq-to-SQL - check out some of the points here .

This article shows you very well how to write Linq-to-Entities queries in your code.



Linq-to-Entities does not yet support the full Linq-to-SQL feature set, but EF4 (with .NET 4.0) is just around the corner (due to be released by the end of 2009, Microsoft says) and will bring massive results. more functionality and perfection in the EF space! Stay up to date.

Mark

+3


source







All Articles