PDC 2008 Experience: Day 2: Entity Framework Futures
The Data Platform
Layers of the data platform
The Data Access Layer -> Integration aggregation sync --> Reporting and Analytics -> Management deployment policy and security --> Models and Workflow
Joining the layers together
- Core storage
- Data access API's and frameworks
- Mid-tier frameworks and technologies
- Client technologies
Consumer Segmentation
This missing from the first version of the Entity Framework
- Tradition data developer (basic ADO.NET developer)
- Scripting / rebel frameworks (Struts, nHibernate, ActiveRecord, Domain Driver Design)
- LOB scripting / macro writers (SharePoint, Excel developers)
- Information Worker (The typically office user)
The Entity Framework v1 was geared towards
- Model centric data developer (Enterprise Architects)
A Lap Around Framework v2
Entity Creation from Code
- The Entity framework tries to map your database table to your C# class automatically. NO MAPPING FILES REQUIRED.
- If the table names and or fields are different you can map it with attributes
1: [TableMapping(Schema="sys", TableName="tables")]
2: [ColumnMapping(PropertyName="TableKeyKey", ColumnName="object_id")]
3: [Key(PropertyName="Id")]
4: public class MyTableObject
5: {
6: public int Id { get; set;}
7: public string Name { get; set;}
8: }
Entity Creation from Model
You will be able to create entities from a drag and drop designer within Visual Studio.
Creation from a Framework Perspective
- Support for deferred loading
- Support for table value functions
1: public void TvfDemo(DataContext context)
2: {
3: var cp = from in context.Products
4: where p.ProductID == 799
5: select new {Product=p, Customers = context.GetCustomersForProduct())};
6:
7: foreach(var o in cp)
8: {
9: Console.WriteLine(o.Product.Name)
10: {
11: foreach(customer c in o.Customers)
12: {
13: Console.WriteLine(c.Name);
14: }
15: }
16: }
17: }
- Support for model driven functions (the functions a created with the model or XML representation of the model)
1: // c.FirstName + c.LastName;
2: c.FullName()
Other Features
- You can create complex types (Types with multiple properties)
Entity Framework, EDM, and Oslo
- EDM and Entity Framework could be domains in Oslo