Daniel Simmons Dev Manager Microsoft Session Code: DTL401.

Slides:



Advertisements
Similar presentations
Shyam Pather Development Manager Microsoft Session Code: DTL402.
Advertisements

Matthew McDermott, MVP Principal Consultant Catapult Systems, Inc. Session Code: OFC315.
Ivan Towlson Mindscape Session Code: WUX305 Agenda Data visualisation and Silverlight/WPF Visualising objects Visualising data sets Toolkits and controls.
Siddharth Bhatia Senior Program Manager Microsoft Session Code: DTL203.
Dan Parish Program Manager Microsoft Session Code: OFC 304.
Scott Cate CloudDB.com Session Code: DTL326.
David J Parker MVP (Visio) bVisual ltd Microsoft Visio 2010.
Robert LevyDoug Kramer Program ManagerDevelopment Lead DTL337.
Samantha Durante Program Manager Microsoft Corporation WUX305.
Chris Menegay VP of Consulting Notion Solutions, Inc. DTL319.
Ram Cherala Principal Program Manager Microsoft Corporation DTL320.
Dmitry Sotnikov New Product Research Manager Quest Software DTL404.
Siddharth Bhatia Senior Program Manager Microsoft Session Code: DTL301.
Brian Harry Technical Fellow Microsoft Session Code: DEV205.
Alyson Powell Erwin Sr. Program Manager Microsoft BIN307.
Arend-Jan Speksnijder Solutions Architect Microsoft Dynamics Lighthouse team Dynamics AX2009 Technical Overview and Demo (DYN301)
Warren Stevens-Baytopp Director YoungBlood Consultants Session Code BIN303.
Asif Rehmani Trainer SharePoint-eLearning.com OFC 301.
OFC308 Hilton Giesenow Development Manager - 3fifteen Host –
Mark Michaelis Chief Computer Nerd IDesign/Itron/IntelliTechture DTL313.
Scott Morrison Program Manager Microsoft Corporation Session Code: WUX308.
Errol Schoenfish Director Product Management Microsoft Session Code: DYN304.
Title of Presentation Name Title Microsoft Corporation.
Entity Framework 4 Deep Dive
Florida certified and insured contractor
Name Title Company Name
Имя Должность Microsoft
Florida certified and insured contractor
Tech·Ed North America /6/2018 2:20 AM
Name Title Company Name
6/13/2018 1:23 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Name Title Company Name
Name Title Company Name
Notebook Cover Guidelines
Microsoft Ajax Taking Ajax to the Next Level
9/11/2018 5:53 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Tech Ed North America /13/ :13 AM Required Slide
Tech·Ed North America /14/2018 7:13 PM
Microsoft Build /21/2018 8:34 PM © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY,
Implementing RESTful Services Using the Microsoft .NET Framework
Tech·Ed North America /19/ :44 PM
Architecture of Master Data Services in Microsoft SQL Server 2008 R2
11/22/2018 8:05 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Name Title Department or Unit
2010 Microsoft BI Conference
12/5/2018 3:24 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Tech·Ed North America /7/2018 2:51 PM
Introducing Microsoft SQL Server 2008 R2 Master Data Services
Authoring for Microsoft Silverlight 4 with Microsoft Expression Blend
Tech Ed North America /1/ :36 AM Required Slide
Tech Ed North America /1/2019 2:58 AM Required Slide
1/2/2019 4:22 AM REQUIRED MATERIALS
Tech·Ed North America /2/2019 4:47 PM
What do you get from a papered cow answer :spoiled milk
Tech·Ed North America /17/2019 1:47 AM
Tech·Ed North America /17/2019 6:01 PM
2/17/2019 7:32 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Convergence /19/2019 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Peter Provost Sr. Program Manager Microsoft Session Code: DEV312
Integrating with Windows 8 Experiences
Tech·Ed North America /22/2019 7:40 PM
Building Silverlight Apps with RIA Services
From Development to Production: Optimizing for Continuous Delivery
2010 Microsoft BI Conference
Tech·Ed North America /25/ :53 PM
Hack-proofing your Clients using Windows 7 Security!
Code First Development in Microsoft ADO.NET Entity Framework 4.1
Tech·Ed North America /27/2019 6:20 AM
Tech·Ed North America /17/2019 4:14 PM
Tech Ed North America /6/2019 2:07 PM Required Slide
Presentation transcript:

Daniel Simmons Dev Manager Microsoft Session Code: DTL401

Agenda Goals Priority 1: Increase success with the EF now Priority 2: Prepare for what is coming in EF4 Approach: Create an EF N-Tier Web Application Sketch architecture Build EF data access layer and business objects Customize code generation to add OnValidate Create fake repository and web application Add WCF service and real repository

Target Architecture DB & Service Tier Data Access Layer Business Objects WCF Service Web Server WCF Client Business Objects Web UI Browser

Architectural Considerations Know what tiers are needed and why Tier may have multiple layers Sample mid-tier has DAL, business objects and service Sample web-tier has repository, business objects and UI Sample separates web-tier from mid-tier because… Reduces internal network surface exposed to the DMZ Creates option for web-tier scale out Consider service operations and payload shapes Factors include change rates and trust boundaries Sample uses custom services and shared entities

Mid-Tier Persistence Entity Partial Classes Entity Framework Context Entities DAL Business Objects Generated Hand-Written

Demo #1: DAL and Business Objects Look at an EF Model based on Northwind Examine modifications for concurrency checks Debug optimistic concurrency in action

DAL and Business Objects

Demo 1 Takeaways EF enables separate DAL and business object layers, but there is much less code to write Hand-written DAL is replaced by combination of: EF storage/entity mapping generated context Business objects also generated, but extended with custom business logic Pay attention to concurrency Especially in disconnected scenarios

T4 Output Text Control Code Template Metadata Generated Code T4

Demo #2: T4 and OnValidate Add T4 template to customize generated code Modify template for OnValidate mechanism Add partial class with validation code Test validation

T4 and OnValidate

Demo 2 Takeaways T4 makes customizing code generation easy EF4 will use T4 in a big way Register SavingChanges event handler during context construction EF4 makes SaveChanges virtual ObjectStateManager tracks all changes Use LINQ to Objects to interrogate it Avoid modifying other entities in OnValidate

Web Tier & Repository Pattern Repository Fake Impl Real Impl Web UI Business Objects

Demo #3: Fake Repository & Web UI Add ICustomerRepository interface Create fake implementation Pull in Web UI written using the repository

Fake Repository & Web UI

Demo 3 Takeaways Mental model of a repository is an in-memory collection Centralizes all data access in one place Easy to understand and tune if needed De-couples rest of application from data access Easily create fake or mock implementations Enables multiple real implementations Did I mention that it de-couples the rest of your application from data access?

Cross-tier Communication Persistence WCF Service Web-tier WCF Client Repository Mid-tier Serialized Entities

Demo #4: Connecting the Dots Turn ICustomerRepository into service contract Extend context class with AttachAsModified Add implementation of service contract Examine EF disconnected updates Test the implementation Examine web tier auto-proxy repository Run the final application

Connecting the Dots

Demo 4 Takeaways Concurrency for disconnected operations Maintain concurrency value from first read Change-tracking for disconnected operations Individual property tracking often unnecessary Disconnected graph manipulation Mixed operations quite difficult in 3.5 sp1 State transitions also constrained in 3.5 sp1 Context operations treat graph uniformly Improvements here in EF4 (APIs, Self-Tracking)

What Next? Same patterns apply to.net 3.5 sp1 rich clients EF4 POCO support adds many options Completely separate business objects from DAL Serialize business objects to Silverlight,.Net 2.0, … Additional flexibility in business logic and testability Model-first enables generating DB Code-only removes need for separate metadata and mapping info

More Resources Code EF: EF FAQ: ASP.Net MVC: Docs Sample: T4 Templates: Blogs Mine: EF Design: ADO.Net Team:

Related Content Breakout Sessions DAT308 Design Patterns for Application Architecture with the ADO.NET EF DTL05-INT Surprise! It's the Entity Framework Gotchas DTL312 The ADO.NET Entity Framework: Tips and Tricks Birds of a Feather BOF21 Solving the Unforeseen Challenges of the ADO.NET Entity Framework: How Can.NET Developers Get Better Prepared? BOF65 Implementing the Entity Framework in an n-Tier World Hands-on Labs DTL20-HOL Application Development with the ADO.NET Entity Framework in the Microsoft.NET Framework 4.0

Track Resources Visit the DPR TLC for a chance to win a copy of Visual Studio Team Suite. Daily drawing occurs every day in the TLC at 4:15pm. Stop by for a raffle ticket us/products/teamsystem/default.mspx Please visit us in the TLC blue area

Sessions On-Demand & Community Resources for IT Professionals Resources for Developers Microsoft Certification and Training Resources Microsoft Certification & Training Resources Resources

Complete an evaluation on CommNet and enter to win!

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

PowerPoint Guidelines Subtitle color SampleSample SampleSample SampleSampleSampleSampleSampleSample Sample Sample Sample SampleSample SampleSample SampleSample SampleSample SampleSample SampleSample SampleSample SampleSample Sample Set as default shape SampleSample SampleSampleSampleSample Sample SampleSample SampleSampleSampleSample SampleSample SampleSampleSampleSample SampleSample SampleSample SampleSample SampleSample SampleSample Database SampleSample Itinerary Processing Resolvers Adapter Providers SampleSample

Name Title Company Session Code:

Hidden Speaker Notes Some speakers at Microsoft like to use this slide for hidden “notes slides”. Delete it if you don’t want to use it. NEXT:

Deadlines & Resources Thank you for committing to speak at TechEd North America 2009, Microsoft’s premier event for IT Professionals and Developers. Below is important information regarding your participation: Important Content Deadlines – submit at the Speaker Portal: April 1 at Noon Upload draft of PPT presentation at the Speaker Portal (you must be registered as a speaker to access it)  Your Session Schedule  Manage Slides, follow instructions for Deck Management. April 1-30 Content Review Process (dry run, speaker training, LCA review, etc.) May 6 at Noon Submit final PPT at the Speaker Portal. Additional changes must be brought onsite and editing charges may apply. YOUR PROMPT FINAL PPT SUBMISSION IS APPRECIATED. Slide Design Resources – located at the Speaker Portal Graphics and Images Library (pictures of arrows, devices, people) Books, Webinars, Websites, and much more to help you build a great deck Licensing information and permission for any third-party photography or art must be credited in the PPT or it will be deleted. Points of Contact Direct presentation questions to Direct content questions to your Track PM. (contact info is at the speaker portal) This template is designed for use with Office PowerPoint PRINTING: This template is set to print in color or grayscale, not black and white.

Presentation Outline (hidden slide): Title: Technical Level: Intended Audience: Objectives (what do you want the audience to take away from this session): Presentation Outline (including demos): Speakers: complete this slide using the session information found at the speaker portal.

Scrub Checklist Your final PPT will be scrubbed and posted to CommNet 48-hours prior to the session. Upload your final deck on or before May 6, 2009 at Noon PST. Apply template – backgrounds, colors, positioning, font Verify that required slides are included Remove any non-template logos and graphics from the walk-in slide Correct session title and session code to match session guide Set titles to Title Case and correct widows (widows = single word spilling over to a new line) Replace transition slides with template transition slides Set subtitles to subtitle color, size, and sentence case Correct all type for consistent shadowing Set bullets to template Set software code samples to template code format Correct template application issues as time allows Correct Microsoft product names to follow corporate branding rules Correct misspelled words Remove all comments, hidden slides and speaker notes from slides Set file properties box Set printability in grayscale If time allows, correct slides for readability and consistency If time allows, correct grammar and correct copy to Microsoft style Notify Presentation Manager of any images identified as unlicensed for escalation

Video Title

Customer Title Name Title Company

Demo Title Name Title Company

Partner Title Name Title Company

Announcement Title

PowerPoint Template Subtitle color Set the slide title in “title case” and subheads in “sentence case” The subhead color is defined for this template as the fourth font color from the left Font Size Requirements Main bullet points must not be smaller than 24pt Do NOT use any font size lower than 20pt Set subhead to 36pt or smaller so it will fit on a single line Turn off Auto Resizing on all text boxes

Slide for Showing Software Code Use this layout to show software code The font is Consolas, a monospace font The slide doesn’t use bullets but levels can be indented using the “Increase List Level” icon on the Home menu To use straight quotes " instead of smart quotes ”, do this: 1. Click on the Office Button in the upper left corner 2. At the bottom of the menu, choose PowerPoint Options 3. From the left pane, select Proofing 4. Click on the AutoCorrect Options button 5. Select the AutoFormat As You Type tab, and deselect “Straight quotes” with “smart quotes”. Then Click OK.

Table Format Table Title Column 1 Column 2 Column 3 Column 4 Column 5

Bar Chart Example

Pie Chart Example

Notes on Required Slides In addition to the Walk-in and Title slides, the following slides are required Please add your content and include these in your final presentation

Sessions On-Demand & Community Resources for IT Professionals Resources for Developers Microsoft Certification & Training Resources Resources Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings at TechEd Online. Required Slide Speakers, TechEd 2009 is not producing a DVD. Please announce that attendees can access session recordings at TechEd Online. Microsoft Certification and Training Resources

Related Content Breakout Sessions (session codes and titles) Interactive Theater Sessions (session codes and titles) Hands-on Labs (session codes and titles) Required Slide Speakers, please list the Breakout Sessions, TLC Interactive Theaters and Labs that are related to your session. Required Slide Speakers, please list the Breakout Sessions, TLC Interactive Theaters and Labs that are related to your session.

Track Resources Resource 1 Resource 2 Resource 3 Resource 4 Required Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub. Required Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub.

Complete an evaluation on CommNet and enter to win! Required Slide

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. Required Slide