2. Remaining Schedule 1-8 Exposing and consuming querying services 1/15 Updating data 1/22 Business Logic and validation
3. Agenda Domain query rules The DomainContext Class Asynchronous loading Client-side data caching Shaping data in the client Retrieving object hierarchies A peak under the hood
4. Design-time workflow Server project Client project Domain Service CRUD Domain Service Domain Context Load 2 Invoke Custom logic Build Entity Container Data model Metadata Entity Metadata Entity proxy type 3 Metadata Entity Metadata Entity proxy type Metadata Entity Metadata Entity proxy type 1 DAL Bindable UI Views L2S EF REST/SOAP POCO 4
[EnableClientAccess()]publicclassChinookDomainService:LinqToEntitiesDomainService{publicIEnumerableGetInvoiceByCustomer(intcustomerId){returnObjectContext.Invoices.Where(c=>c.CustomerId ==customerId);}publicCustomerGetCustomerById(intcustomerId){returnObjectContext.Customers.Where(c=>c.CustomerId==customerId);}} public Supported types Entity publicIEnumerableGetCustomersByJoinData(DateTimemindate, DateTimemaxdate){ returnObjectContext.Customers.Where(c=>c.JoinDate>=mindate && c.JoinDate { /* Check for errors, bind to UI, do work */}, null); ctx.Load(query).Completed += newEventHandler(LoadComplete); voidLoadComplete(object sender, EventArgs e) {/* Check for errors, bind to UI, do work */ }