Building nTier Applications with Entity Framework Services (Part 1)
Upcoming SlideShare
Loading in...5

Like this? Share it with your network


Building nTier Applications with Entity Framework Services (Part 1)



Learn how to build real world nTier applications with the new Entity Framework and related services. With this new technology built into .NET, you can easily wrap an object model around your database ...

Learn how to build real world nTier applications with the new Entity Framework and related services. With this new technology built into .NET, you can easily wrap an object model around your database and have all the data access automatically generated or use your own stored procedures and views. The session will demonstrate how to create and consume these new technologies from the ground up and focus on database modeling including views and stored procedures along with coding against the model via LINQ. Dynamic data website will also be demonstrated.



Total Views
Views on SlideShare
Embed Views



2 Embeds 5 3 2



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • Goals:To show a new way of serving up dateGet you thinking to learn more when you leave this presentation
  • How do you or have you designed your applications??? Be truthful!!N-tier application architecture provides a model for developers to create a flexible and reusable application. By breaking up an application into tiers, developers only have to modify or add a specific layer, rather than have to rewrite the entire application over, if they decide to change technologies or scale up. In the term "N-tier," "N" implies any number -- like 2-tier, or 4-tier; basically, any number of distinct tiers used in your architecture. Application architectures are part of Layer 7 of the OSI model.
  • Talk about the separation between database developer and programmer.
  • Talk about the separation between database developer and programmer.
  • Applications can work in terms of a more application-centric conceptual model, including types with inheritance, complex members, and relationships.Applications are freed from hard-coded dependencies on a particular data engine or storage schema.Mappings between the conceptual model and the storage-specific schema can change without changing the application code.Developers can work with a consistent application object model that can be mapped to various storage schemas, possibly implemented in different database management systems.Multiple conceptual models can be mapped to a single storage schema.Language-integrated query (LINQ) support provides compile-time syntax validation for queries against a conceptual model.
  • POCO = Plane Old .NET Classes
  • Demo: AdventureWorks.DataDemo: AdvertureWorks.ExampleDemo: EntityDesignerDiagram.png
  • Demo: AdventureWorks.DataDemo: AdvertureWorks.ExampleDemo: EntityDesignerDiagram.png

Building nTier Applications with Entity Framework Services (Part 1) Presentation Transcript

  • 1. Building nTier Applications with Entity Framework ServicesPart 1
  • 2.
  • 3. Check Out Your Local User Groups!
    San Diego Cloud Computing User Group
    San Diego .NET Developers Group
    San Diego .NET User Group
    San Diego SQL Server User Group
  • 4. Win Free Software!
    Provide your business card (or email and name)*
    Indicate on the back what software you are interested in
    Otherwise I will pick 
    Winners will be picked next week
    *Yes, most likely I’m going to send you and email about my user group ( and or web site (
    CodeRush and Refactor Pro from DevExpress (4)
    SecondCopy (automatic backup software) (5) *
    CodeIt.Right Standard from SubMain (4)
    *Requires mailing address and phone number
  • 5. Agenda
  • 6. Overview
  • 7. nTier Architecture Overview
    Model to create flexible reusable applications
    Only need to modify or add layers instead of rewriting entire applications over
  • 8. User Experience
    Active Directory, Card Space, Windows Identity Foundation
    UI Components
    Windows Forms, Windows Presentation Foundation, ASP.NET (AJAX, MVC), Silverlight, Windows Mobile
    Presentation Layer
    Local Storage/ Cache
    Communications Layer
    Windows Communication Foundation (WCF), WCF Data Services, Web Services, Sync Services, Azure (Cloud), RIA Services, Workflow Services
    Business Layer
    Business Entities
    T4 Templates
    Business Components
    Business Workflow
    Windows Workflow Foundation
    Data Layer
    Entity Framework, LINQ to SQL, DataSets
    SQL Server
  • 9. Entity Framework
  • 10. Object Relational Mapping
    What is ORM?
    Technique for working with relational tables as if they were objects in memory
    Intention is to hide away the complexity of the underlying tables and give a uniform way of working with data
    Why use ORM?
    Retain database independence
  • 11. Object Relational Mapping
    It’s nothing new, just new to .NET
    There are many ORMs for .NET developers already in existence. E.g.
    LLBLGen Pro
  • 12. The Microsoft Entity Data Model
    An extended relational model with Entity-Relationship Model concepts
    Entity Types
    Strong type with Identity
    Scalar/Complex properties
    Hold instances of Entity Types
    Similar to relational tables
    Can have multiple Entitysets of the same EntityTypes
    Relationships ("Associations")
    Named relationships between Entities
    0..1:*, 0..1:0..1, 1:1, 1:M, M:N
    Navigation may be exposed as NavigationProperties on EntityTypes
    Contains instances of associations
    May be queried directly
    Contains EntitySets, AssociationSets
    EmployeeID = 294272LoginID = adamTitle = "Dev Lead"VacationHours = 0…
    EmployeeID = 729742LoginID = peteTitle = "Developer"VacationHours = 0…ExpenseAccount = …CarLicenseNum = ……
    EmployeeID = 729742LoginID = peteTitle = "Developer"VacationHours = 0…ExpenseAccount = …CarLicenseNum = ……
    EmployeeID = 729742LoginID = peteTitle = "Developer"VacationHours = 0…ExpenseAccount = true…
  • 13. EDM & Entity Framework?
    The Entity Framework (EF) is an Object Relational Modeling tool leveraging the EDM
    Focus on your domain, not how to persist!
    EDM is used to describe your model.
    Allows different rate of change between database and code!
    EF uses a storage model and mapping to enable this.
  • 14. ADO.NET Entity Framework
  • 15. EF Providers in Progress
  • 16. LINQ to Entities – Lots of Topics
  • 17.
  • 18. Pain Points in v3.5 SP1
    Pluralization/ Singularization
    Foreign Keys
    Model First
    Lazy Loading
    Additional LINQ Operators
    L2S Features & Patterns
    SQL Gen Improvements
  • 19. Fixing the Paint Points in EF1
    Advanced/ New Features
  • 20. Model First
    Create your conceptual model first (not from an existing database)
    Wizard will allow the creation of sql scripts to create database scripts.
    Also will create EDM files
    Creates SQL Server, SQL Server Express, SQL Server Compact database scripts.
  • 21. Lazy Loading
    Enables retrieving all related data (without asking for it)
    Off by default
    Settable on the ContextOptions
    Good for doing reporting!
    Not great for going across services
    Dim ctx As New AdventureWorksLT_DataEntities()
    ctx.ContextOptions.LazyLoadingEnabled = True
  • 22. T4 Templates
    Override default EF classes to create…
    POCO Entity Generator
    Better for going over RESTful service layers
    Self-Tracking Entity Generator
    Better for server/ client local storage.
    Auto generates classes when models change!
    Or can be run manually.
    Easily modifiable for your own needs
    Once you learn the T4 scripting language.
  • 23.
  • 24. Summary
  • 25. Conclusion
  • 26. Resources
    ADO.NET Team Blog
    EF Design Blog
    Visual Studio Data Blog
  • 27. Resources
    Dan Simmons Blog
    MSDN Code Gallery
    WCF Data Services Learning Guide:
    WCF Data Services Team Blog
  • 28. Required Book!
    EF4 In Aug 2010