Session Title That is Really Long and Covers Two Lines

Download Report

Transcript Session Title That is Really Long and Covers Two Lines

Building Data Driven Applications
Using WinRT and XAML
Sergey Barskiy, Magenic
Microsoft MVP – Data Platform
Principal Consultant
Level: Intermediate
Overview
•
•
Dealing with Data in XAML Based
Windows 8 Metro Style Applications
WinRT – Windows Runtime
Data Options in WinRT
•
Persisting Data
– Local
– Remote / Cloud
Data Binding
•
•
INotifyPropertyChanged
INotifyCollectionChanged
Data Options In Detail
•
WCF Custom Services
– SOAP
– REST
•
•
Web Api
OData
– WCF Data Services
•
Local
– Windows.Storage
– SQLite
Setting up For WCF Development
•
•
•
Create Metro Style Application
Check “Enable Loopback Address” option
Update Manifest to enable Networking and
Internet Client
WCF
•
WCF Custom Services
– Create new WCF Service / Add Reference
Data Contacts / Data Members / Operation Contracts
– End point configuration
– Querying and updating data
– SOAP vs. REST
Soap is easier to use / proxy generation
REST offers better performance and scalability
WCF SOAP Service
•
Create new Service.
Use Service Contract
Operation Contract
Data Member
– Define operations
– Build the service
– Add Service Reference to generate a proxy in
Windows Metro Style project
– Handle data binding!
– Deploy the service
– Setup URL on proxy
WCF REST Service
•
Create new Service.
– Use new template to get a head start
– Define operations
WebGet, WebInvoke
Message Type XML vs. JSON
– Build the service
– Deploy the service
– Use WebClient or HttpWebRequest
– Use XML Serializer or JSON Serializer to convert data
between service and client
– Use headers to set content type
WCF Data Services
•
WCF Data Services
– Define a service
– Create proxy (http://odata.codeplex.com)
DataSvcUtil.exe /uri:http://localhost/odataservice.svc/
/out:MyModel.cs /Version:2.0 /DataServiceCollection
– Configure end point
– CRUD operations
Data Service Collection
Web Api
•
Web Api
– Define a controller
– Add actions
Local Storage
•
Using Isolated Storage
– Using Serializers
– Helper class / Isolated Storage DB
SQLite
•
Platform specific
– Very performant
– Has ORM you can use.
Data Options in WinRT
•
Summary
– Remote vs. local data
– Hosting remote data
Azure / Cloud
Hosting providers
– Data binding / storage solutions
Contact Information
•
•
[email protected]
http://DotNetSpeak.com