c# - Can someone please clarify the key difference between Entity Framework and Typed Datasets? -
I am comparing EF and type datasets for their usefulness. I was unable to see why the use of EF would be used on the dataset you typed, if EF is only bound to SQL Server. But is it true that the details of the links in EF are evaluated late if you do something like this:
db.Customers.where (c => c.Name == " John EME will create such a query: Select from customers * where * name = 'John Smith'
But with the typed dataset you can write Are:
bll.GetCustomers (). Where (c => c.Name == "John Smith")
which is very similar But the difference runs first:
from customer And then using the standard collection library, the lines named "John Smith" find: EF in theory would mean more efficient. Is it correct?
Yes, with the unit framework, By using code> IQueryable :
var result = db.Customers.Where (C => c.Name == "John Smith");
Internally, the result is IQueryable & lt; Customers & gt;
(or your type). This allows the provider (EF) to customize the way it is executed internally. In the case of SQL Server, the actual query sent to the server will already have the SQL WHERE clause, which in turn will mean that you will only return one record (if "name" is unique) back to DB from each record .
Using the typed dataset, you will return each record, then find the result for the appropriate name later. This is probably less efficient.
Comments
Post a Comment