Reputation: 1
I have 70.000 records in table. When i am trying to get all records with entityframework it nearly takes about 20 seconds. On the other hand when try to get all records with linqtosql it takes about 2 seconds. Why entityframework works too slower than linqtosql. Do i need to make any customization for entityframework to works faster.
Upvotes: 0
Views: 134
Reputation: 26694
A more fair test would be to return an anonymous type in both queries and than compare the speeds. This way the resulting object from both linq-to-sql
and entity-framework
will be the same
For example:
var query = from x in context.Entity
select new
{
x.Property1,
x.Property2,
.
.
.
};
Upvotes: 1