+ All Categories
Home > Documents > EF4 and WCF Data Services 4 Max Weber Tallan

EF4 and WCF Data Services 4 Max Weber Tallan

Date post: 04-Apr-2018
Category:
Upload: jorge-garcia
View: 220 times
Download: 0 times
Share this document with a friend

of 31

Transcript
  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    1/31

    building software tohelp our clients growSINCE 1985

    www.tallan.com

    Entity Framework 4 and WCFData Services 4

    Max Weber - Senior Consultant

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    2/31

    Get started with Entity Framework 4

    Get started with WCF Data Services 4

    Create website iBlog

    12/4/2012 2Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    Presentation Goals

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    3/31

    Entity Data Model

    Entity Framework 4

    Open up Visual Studio

    WCF Data Services 4

    Open up Visual Studio

    Summary / Questions

    Cake

    12/4/2012Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    Presentation Agenda

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    4/31

    Entity Data Model

    The Entity Data Model (EDM) is a set of concepts thatdescribe the structure of data, regardless of its storedform. The EDM borrows from the Entity-RelationshipModel described by Peter Chen in 1976, but it alsobuilds on the Entity-Relationship Model and extends itstraditional uses.

    Extensions to E-R Model:

    Separation of the entities and relationships from theirstorage medium

    http://msdn.microsoft.com/en-us/library/ee382825.aspx

    12/4/2012 4Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    What is the Entity Data Model?

    http://msdn.microsoft.com/en-us/library/ee382825.aspxhttp://msdn.microsoft.com/en-us/library/ee382825.aspxhttp://msdn.microsoft.com/en-us/library/ee382825.aspxhttp://msdn.microsoft.com/en-us/library/ee382825.aspx
  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    5/31

    Entity Type

    entity key, inheritance, entity Sets, entity container

    Association Type

    foreign key, multiplicity, navigation properties,

    association set, entity container Property

    Boolean, Int32, String

    DateTime, Guid, BinaryComplex Types

    12/4/2012 5Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    Entity Data Model Key Concepts

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    6/31

    Entity Framework Overview

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    7/31

    Entity Framework Overview

    12/4/2012 7Tallan, Inc. Proprietary and Confidential. Copyright 2010.

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    8/31

    Conceptual Model

    Storage Model

    Data Providers

    12/4/2012 8Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    Entity Framework 4

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    9/31

    Conceptual schema definition language (CSDL)

    Conceptual model == Domain model

    .csdl file extension

    CSDL is Entity Frameworks implementation of the

    Entity Data Model

    12/4/2012 9Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    Conceptual Model Entity Framework 4

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    10/31

    Store schema definition language (SSDL)

    Storage model == Logical model

    Storage models are provider-specific

    .ssdl file extension

    12/4/2012 10Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    Storage Model Entity Framework 4

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    11/31

    Mapping specification language (MSL)

    Maps between conceptual and storage models

    .msl file extension

    12/4/2012 11Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    Mapping Concepts to Storage EF4

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    12/31

    EF uses the ADO.NET Data Provider model

    Providers

    MS SQL Server Indirect access to other DBs using ODBC, OLEDB

    VistaDB

    Devart

    OpenLink Software

    Synergy

    5+ moreADO.NET Data Providers List

    http://msdn.microsoft.com/en-us/data/dd363565.aspx

    12/4/2012 12Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    Providers Entity Framework 4

    http://msdn.microsoft.com/en-us/data/dd363565.aspxhttp://msdn.microsoft.com/en-us/data/dd363565.aspxhttp://msdn.microsoft.com/en-us/data/dd363565.aspxhttp://msdn.microsoft.com/en-us/data/dd363565.aspx
  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    13/31

    Entity Data Model Wizard

    ADO.NET Entity Data Model Designer

    Update Model Wizard

    Command line tool EDM Generator (EdmGen.exe)

    12/4/2012 13Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    Entity Data Model Tools

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    14/31

    T4 Templates used to generate Entity classes from

    CSDL

    Entities based on EntitySet

    Tied to .NET, System.Data

    Plain Old CLR Objects (POCO)Need POCO extension from Visual Studio Gallery

    POCO Proxy

    Extensions from Visual Studio GalleryADO.NET POCO Entity Generator

    Tangible T4 Editor

    12/4/2012 14Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    Class Generation Entity Framework

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    15/31

    Code Time! Entity Framework 4

    12/4/2012 15Tallan, Inc. Proprietary and Confidential. Copyright 2010.

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    16/31

    Entity Framework: Recap

    12/4/2012 16Tallan, Inc. Proprietary and Confidential. Copyright 2010.

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    17/31

    Formerly .NET Data Services (aka Astoria)

    Description:

    WCF Data Services enables creation and consumptionof data services for the Web or an intranet by using the

    Open Data Protocol (OData).

    WCF Data Services

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    18/31

    Architecture Overview :

    WCF Data Services

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    19/31

    Exposes data as resources (URI)

    http://localhost/Northwind.svc/Customers(ALFKI)

    http://localhost/Northwind.svc/Customers('ALFKI')/Orders?$filter=Freight gt 50

    12/4/2012 19Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    RESTful work WCF Data Services

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    20/31

    Definition

    OData enables you to expose your data as resourcesthat are addressable by URIs

    Enables you to access and change data by using the

    semantics of representational state transfer (REST)Standard HTTP verbs supported:

    GET, PUT, POST, DELETE.

    Open Data Protocol (OData)

    Reference: WCF Data Services Overview -http://msdn.microsoft.com/library/cc668794.aspx

    http://msdn.microsoft.com/library/cc668794.aspxhttp://msdn.microsoft.com/library/cc668794.aspx
  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    21/31

    Atom

    JSON

    XML

    12/4/2012 21Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    Output Formats WCF Data Services

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    22/31

    Entity Framework Provider

    Uses Entity Data Models to structure access

    Reflection Provider

    Exposes data structures with interface IQueryable

    Create/Update/Delete with interface IUpdatable

    Custom Provider

    Roll your own

    Link to WCF Data Services Providers http://msdn.microsoft.com/en-us/library/dd672591.aspx

    12/4/2012 22Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    Freedom of data source WCF DataServices

    http://msdn.microsoft.com/en-us/library/dd672591.aspxhttp://msdn.microsoft.com/en-us/library/dd672591.aspxhttp://msdn.microsoft.com/en-us/library/dd672591.aspxhttp://msdn.microsoft.com/en-us/library/dd672591.aspx
  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    23/31

    Service Operators

    Act at a service level

    Interceptors

    Act at an entity set level

    12/4/2012 23Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    Custom Business Logic WCF DataServices

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    24/31

    WCF Data Services Client Library

    .NET Framework

    Silverlight

    OData SDK

    Javascript (AJAX)PHP

    Java

    RubyWindows Phone 7 (not yet released)

    Objective-C (iPhone) (not yet released)

    12/4/2012 24Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    Client Libraries WCF Data Services

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    25/31

    Code Time! WCF Data Services

    12/4/2012 25Tallan, Inc. Proprietary and Confidential. Copyright 2010.

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    26/31

    OOTB IE Experience with WCF DS Atom feeds bad

    Make this change to see Atom feeds properly:

    Tools-> Internet Options -> Feeds and Web Slices(Settings)

    Uncheck Turn on feed reading view

    12/4/2012 26Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    WCF Data Services Atom feeds in IE

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    27/31

    Recap:

    WCF Data Services

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    28/31

    Entity Data Model

    Entity Framework 4

    Conceptual Model

    Storage Model

    Class generation using T4 TemplatesWCF Data Services 4

    OData v2

    RESTful servicesMultiple Data Providers

    Multiple Output formats

    12/4/2012 28Tallan, Inc. Proprietary and Confidential. Copyright 2010.

    In Summary

  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    29/31

    This slide deck will be made available from the

    following locations:

    Tallan blogs - blogs.tallan.com

    CTDOTNETwww.ctdotnet.org

    Distribution of slide deck

    http://blog.tallan.com/http://www.ctdotnet.org/http://www.ctdotnet.org/http://blog.tallan.com/
  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    30/31

    Visual Studio Gallery

    Visual Studio - Entity Framework 4.0 and WCF DataServices 4.0 in Visual Studio 2010

    What's New and Cool in Entity Framework 4.0DevelopMentor

    ADO.NET Entity Framework

    Entity Framework At-a-Glance

    WCF Data Services

    WCF Data Services Overview

    WCF (ADO.NET) Data Services At-a-Glance

    Data Development Videos Programming Entity Framework

    Don't Be Iffy (Julie Lerman)

    Resources and Questions? Then Cake

    http://visualstudiogallery.msdn.microsoft.com/en-us/http://msdn.microsoft.com/en-us/magazine/ee336128.aspxhttp://msdn.microsoft.com/en-us/magazine/ee336128.aspxhttp://www.develop.com/entityframework4http://www.develop.com/entityframework4http://www.develop.com/entityframework4http://www.develop.com/entityframework4http://msdn.microsoft.com/en-us/data/aa937723.aspxhttp://msdn.microsoft.com/en-us/data/aa937709.aspxhttp://msdn.microsoft.com/en-us/data/bb931106.aspxhttp://msdn.microsoft.com/library/cc668794.aspxhttp://msdn.microsoft.com/en-us/data/aa937697.aspxhttp://msdn.microsoft.com/en-us/data/videos.aspxhttp://learnentityframework.com/learnentityframework/http://thedatafarm.com/blog/http://thedatafarm.com/blog/http://thedatafarm.com/blog/http://thedatafarm.com/blog/http://learnentityframework.com/learnentityframework/http://msdn.microsoft.com/en-us/data/videos.aspxhttp://msdn.microsoft.com/en-us/data/aa937697.aspxhttp://msdn.microsoft.com/en-us/data/aa937697.aspxhttp://msdn.microsoft.com/en-us/data/aa937697.aspxhttp://msdn.microsoft.com/en-us/data/aa937697.aspxhttp://msdn.microsoft.com/en-us/data/aa937697.aspxhttp://msdn.microsoft.com/library/cc668794.aspxhttp://msdn.microsoft.com/en-us/data/bb931106.aspxhttp://msdn.microsoft.com/en-us/data/aa937709.aspxhttp://msdn.microsoft.com/en-us/data/aa937709.aspxhttp://msdn.microsoft.com/en-us/data/aa937709.aspxhttp://msdn.microsoft.com/en-us/data/aa937709.aspxhttp://msdn.microsoft.com/en-us/data/aa937709.aspxhttp://msdn.microsoft.com/en-us/data/aa937723.aspxhttp://www.develop.com/entityframework4http://www.develop.com/entityframework4http://www.develop.com/entityframework4http://www.develop.com/entityframework4http://msdn.microsoft.com/en-us/magazine/ee336128.aspxhttp://msdn.microsoft.com/en-us/magazine/ee336128.aspxhttp://msdn.microsoft.com/en-us/magazine/ee336128.aspxhttp://msdn.microsoft.com/en-us/magazine/ee336128.aspxhttp://msdn.microsoft.com/en-us/magazine/ee336128.aspxhttp://visualstudiogallery.msdn.microsoft.com/en-us/
  • 7/30/2019 EF4 and WCF Data Services 4 Max Weber Tallan

    31/31

    Its time for cake!

    12/4/2012 31Tallan, Inc. Proprietary and Confidential. Copyright 2010.


Recommended