ADO.NET Data Services & Entity Framework
Upcoming SlideShare
Loading in...5
×
 

ADO.NET Data Services & Entity Framework

on

  • 1,803 views

Introduction to ADO.NET Data Services (Astoria Project) and Entity Framework

Introduction to ADO.NET Data Services (Astoria Project) and Entity Framework

Statistics

Views

Total Views
1,803
Views on SlideShare
1,765
Embed Views
38

Actions

Likes
0
Downloads
0
Comments
0

4 Embeds 38

http://www.linkedin.com 31
https://www.linkedin.com 5
http://www.lmodules.com 1
http://www.slideshare.net 1

Accessibility

Categories

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.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

ADO.NET Data Services & Entity Framework ADO.NET Data Services & Entity Framework Presentation Transcript

  • ADO.NET Data Services&Entity FrameworkDiana NemeşuSeptember 2009
    1
  • Agenda
    2
    • Telemon Project
    • Intro ADO.NET Data Services:
    - Why?
    - How?
    • ADO.NET Entity Framework
    • Demo
  • Telemon Project
    3
    Purpose: to build a platform for e-health, namely a platform for Telemonitoring "anywhere and anytime”, in real time;
    Parameters monitored: ECG, Resp, Temp, Acc, SPO2, Blood pressure
    Technologies:
    - DB: SQLite, SQL Express;
    - ADO.NET / ADO.NET Data Services;
    - WinForms, DevExpress
  • Telemon Overview
    4
    Sensor1
    Sensor2
    Device
    (SmartPhone)
    Server Telemon
    Doctor Application
    TelemonDataBase
    Telemon Services
  • Device Application
    5
  • Doctors Application
    6
  • ADO.NET Data Services “Astoria”http://astoria.mslivelabs.com/
    7
  • Why?
    8
    Provides an API that allows data to be created and consumed over HTTP using RESTful service. 
    Supports all database operations using URI. 
    Can expose an entity model via an URI. 
    Is RESTful service to support CRUD operations on database. 
    Could be consumed by any type of client like Windows, Silverlight, Web , AJAX and console.
  • How?
    9
    Data is sent over HTTP in both directions;
    Defines a hosting interface IDataServiceHost that abstracts its implementation from a specific host (WCF, ASP.NET, IIS);
    Server operations:
    - static layer that implements URL translation
    - data source being surfaced to the data service.
  • Concepts
    10
    REST:
    - focuses on key components that enable easy integration and interaction with other systems;
    - approaches the need for interoperability and communication between systems through separation of layers;
    - Yahoo, Facebook, Flickr, Amazon, Google, ebay, digg;
  • 11
    The ADO.NET Data Services framework provides patterns and libraries that enable the creation and consumption of data driven services for the web;
    Expose Data Source to Data Service:
    - Entity Framework
    - LINQ to SQL
    - Surfacing custom data sources using CLR classes
    - Creating a custom IQueryable<T> provider to surface a custom data source
    Offline-Enabled Data Services (Astoria Offline)
  • System Requirements
    12
    Microsoft .NET Framework 3.5 SP1
    Visual Studio 2008 SP1
    ADO.NET Data-access providers
    (Microsoft SQL Server 2005)
  • ADO.NET Entity Framework
    13
    Introduction
    ADO.NET Providers
    Entity Data Model (EDM)
    Mapping
    Database Schema vs Conceptual Schema
    Using Object Model
    http://msdn.microsoft.com/en-us/library/aa697427(VS.80).aspx
  • Introduction to Entity Framework
    14
    Is a set of data access APIs for the Microsoft .NET Framework;
    Version 1 was included with .NET Framework 3.5 SP1 and Visual Studio 2008 SP1; version 4.0 is available in Beta form as part of Visual Studio 2010;
    Abstracts the relational(logical) schema of the data that is stored in a database and presents its conceptual schema to the application;
  • 15
    ADO.NET Providers: Connector/Net(MySQL), DB2.NET, dotConnect, Oracle Data Provider for .NET, DataDirect Connect for ADO.NET, Npgsql;
    EDM:
    - specifies the conceptual model of the data via the Entity-Relationship data model;
    - the EDM schema is expressed in the Schema Definition Language (XML format);
    Mapping: a 1:1 (one to one) mapping is generated between the database schema and the conceptual schema;
  • Conceptual Schema
    Database Schema
    16
  • Using Object Model
    17
    using(telemonEntities DB=new telemonEntities())
    {
    foreach (User user in DB.User)
    {
    Console.WriteLine("User{0} ** Username{1}",
    user.Id,
    user.Username);
    }
    foreach (Alarmealarma in DB.Alarme)
    {
    Console.WriteLine(
    "Alarm: {0} ** Username: {1} ** Session: {2}",
    alarma.Id,
    alarma.User.Username,
    alarma.PacientSession.Name);
    }
    ObjectQuery<SignalData> signals = DB.SignalData;
    IQueryable<SignalData> signalList =
    from s in signals
    select s;
    foreach (SignalData signal in signalList
    {
    Console.WriteLine("Signal{0} ** Session{1} ** Username{2}",
    signal.Id,
    signal.PacientSession.Name,
    signal.PacientSession.User.Username);
    }
  • Demo
    18
  • 19
    ADO.NET Data ServicesQuestions
    Diana Nemeşu
    din@rms.ro
    dyana0106@yahoo.com