EditEntity Framework Essentials
Query option staircase, each layer up has a (small) performance hitLINQ to Entities
Object Services
EntityClient
ADO.NET
Direct Provider
Object Services
- Provides object serialization
- Queries are written in either EntitySQL or LINQ to Entities
- Identity Map
- Change Tracking
- Unit of Work (will persist in a transaction)
using (var context = AdventureWorksModel.AdventureWorksContext())
{
var customers = (from customer in context.Customer
where customer.EmailAddress.Length > 20
select customer).ToList();
}
- Refreshing models : from designer you can update the models from the database. If columns are added, deleted or changed, you can update the model from the current DB connection....
- in V2 there will be less attributes on model entity classes describing how persistance will take place.
- Object services allows you to order and use various extension methods that will impact the LINQ query. E.g. To order by a specified user field name, we can use the OrderBy extension on the IQueryable Entity Framework implementation.
using (var context = AdventureWorksModel.AdventureWorksContext())
{
// note: "it" refers to the current entity! C# had "this", VB had "me", entity framework has "it"! This allows specifying a user input string in this case
var customers = (from customer in context.Customer.OrderBy("it.FirstName")
where customer.EmailAddress.Length > 20
select customer).ToList();
}
- Lay loading will occur as long as you specify the sub-tree in a where clause, and you can turn it ALL on in the designer. More info to come in the RTM version.
- Cascading delete options supported in XML at the moment and may be surrported in the designer.