+ All Categories
Home > Documents > Введение в ADO.NET Data Services

Введение в ADO.NET Data Services

Date post: 16-Jan-2016
Category:
Upload: joyce
View: 35 times
Download: 2 times
Share this document with a friend
Description:
Введение в ADO.NET Data Services. Viktor Shatokhin Microsoft Ukraine http://saf.in.ua. http://gettag.mobi. Содержание. Необходимость в ADO.NET Data Services Основные характеристики Создание и использование. Необходимость в ADO.NET Data Services. HTML + Javascript. DLL + XAML. - PowerPoint PPT Presentation
25
Введение в ADO.NET Data Services Viktor Shatokhin Microsoft Ukraine http://saf.in.ua http:// gettag.mobi
Transcript
Page 1: Введение в  ADO.NET Data Services

Введение в ADO.NET Data Services

Введение в ADO.NET Data Services Viktor ShatokhinMicrosoft Ukraine

http://saf.in.uahttp://gettag.mobi

Page 2: Введение в  ADO.NET Data Services

СодержаниеСодержание

Необходимость в ADO.NET Data ServicesОсновные характеристикиСоздание и использование

Page 3: Введение в  ADO.NET Data Services

Необходимость в ADO.NET Data ServicesНеобходимость в ADO.NET Data Services

HTML + Javascript

Data (XML, etc)

DLL + XAML

Data (XML, etc) Data (XML, etc)

Mashup UI

Data Feeds

AJAX Applicatio

ns

Silverlight Applicatio

ns

Online Services

Mashups

Page 4: Введение в  ADO.NET Data Services

REST интерфейс для работы с даннымиREST интерфейс для работы с данными

Entity Data Model

URIs

HTTP

Форматы

Источники

• Модель• Сущности и ассоциации ресурсы и

ссылки

Page 5: Введение в  ADO.NET Data Services

Бизнес логика и контроль доступаБизнес логика и контроль доступа

Сервисные операции

• Произвольные операции, например, /CustomersByCity?city='Madrid'

Видимость

• Управление правами доступа в рамках контейнера• Операции чтения, записи и модификации

Управление запросами

• Произвольная политика безопасности

Управление поведением

• Обработка запросов HTTP PUT/POST/DELETE

Page 6: Введение в  ADO.NET Data Services

ОпцииОпции

Опция Пример

$expand /Customers(‘ALFKI’)?$expand=Orders

$orderby /Customers?$orderby=City desc,CompanyName asc

$skip /Customers?$skip=10

$top /Customers?$top=5

$filter /Customers?$filter=City eq ‘London’

$metadata

$links /Category(5)/$links/Product

$batch

Page 7: Введение в  ADO.NET Data Services

ВыраженияВыражения

Logical Описание Пример

eq Equal /Customers?filter=City eq 'London'

ne Not equal /Customers?filter=City ne 'London'

gt Greater than /Product?$filter=UnitPrice gt 20

ge Greater than or equal /Orders?$filter=Freight ge 800

lt Less than /Orders?$filter=Freight lt 1

le Less than or equal /Product?$filter=UnitPrice le 20

and Logical and /Product?filter=UnitPrice lteq 20 and UnitPrice gt 10

or Logical or /Product?filter=UnitPrice lteq 20 or UnitPrice gt 10

not Logical negation /Orders?$ ?$filter=not endswith(ShipPostalCode,'100')

Page 8: Введение в  ADO.NET Data Services

ВыраженияВыражения

Arithmetic Описание Пример

add Addition /Product?filter=UnitPrice add 5 gt 10

sub Subtraction /Product?filter=UnitPrice sub 5 gt 10

mul Multiplication /Orders?$filter=Freight mul 800 gt 2000

div Division /Orders?$filter=Freight div 10 eq 4

mod Modulo /Orders?$filter=Freight mod 10 eq 0

Grouping Operators

( ) Precedence grouping /Product?filter=(UnitPrice sub 5) gt 10

Page 9: Введение в  ADO.NET Data Services

Работа со строкамиРабота со строками

bool substringof(string p0, string p1)

string substring(string p0, int pos, int length)

bool endswith(string p0, string p1)

string tolower(string p0)

bool startswith(string p0, string p1)

string toupper(string p0)

int length(string p0) string trim(string p0)

int indexof(string arg) string concat(string p0, string p1)

string insert(string p0, int pos, string p1)

string remove(string p0, int pos)

string remove(string p0, int pos, int length)

string replace(string p0, string find, string replace)

string substring(string p0, int pos)

Page 10: Введение в  ADO.NET Data Services

Работа с датамиРабота с датами

int day(DateTime p0)

int hour(DateTime p0)

int minute(DateTime p0)

int month(DateTime p0)

int second(DateTime p0)

int year(DateTime p0)

Page 11: Введение в  ADO.NET Data Services

Математические операцииМатематические операции

double round(double p0)

decimal round(decimal p0)

double floor(double p0)

decimal floor(decimal p0)

double ceiling(double p0)

decimal ceiling(decimal p0)

Page 12: Введение в  ADO.NET Data Services

Работа с типамиРабота с типами

bool IsOf(type p0)

bool IsOf(expression p0, type p1)

<p0> Cast(type p0)

<p1> Cast(expression p0, type p1)

Page 13: Введение в  ADO.NET Data Services

Расширенные возможностиРасширенные возможности

Параллелизм

• Реализуется в модели сущностей• Используются возможности HTTP (ETags)

Пакетная обработка

• Пакетная обработка данных• Все или ничего для CUD операций

Кеширование

• Использование HTTP кеширования

Отладка

• Отладка привычными средствами• Трассировка

Page 14: Введение в  ADO.NET Data Services

РесурсыРесурсы

ADO.NET Data Services Team: http://blogs.msdn.com/astoriateamOnline Forum:

Search “ADO.NET Data Services”: http://forums.microsoft.com

Data Developer Center:http://msdn.microsoft.com/data

Gil Fink Blog:http://blogs.microsoft.co.il/blogs/gilf

Phani Raj Bloghttp://blogs.msdn.com/phaniraj/

AJAX librarieshttp://www.codeplex.com/aspnet/

SQL Services Labshttp://www.microsoft.com/azure/sqllabs.mspx

Page 15: Введение в  ADO.NET Data Services

Введение в ADO.NET Data Services 1.5

Введение в ADO.NET Data Services 1.5 Viktor ShatokhinMicrosoft Ukraine

http://saf.in.uahttp://gettag.mobi

Page 16: Введение в  ADO.NET Data Services

СодержаниеСодержание

• Серверная функциональность• Row count• Server-side paging• Friendly feeds• BLOB streams

• Клиентская функциональность• Row Count• WPF/SL data binding

Page 17: Введение в  ADO.NET Data Services

Row CountRow Count

/Products

n # of products

/Products?$skip=10&$take=10

10 products

1. Нет пейджинга2. Большой объем данных

1. Сколько всего?

Page 18: Введение в  ADO.NET Data Services

Row CountRow Count

/Products/$count?$skip=10&$take=10

Count

/Products?$skip=10&$take=10&$inlinecount=allpages

10 products +Inline Count

1. Нет передачи данных

Page 19: Введение в  ADO.NET Data Services

Server-Side PagingServer-Side Paging

/Products

500,000 products

500,000product records

Никогда нельзя полагаться на правильность поведения клиента

Page 20: Введение в  ADO.NET Data Services

Server-Side PagingServer-Side Paging

/Products

20 products +link to next page

/Products?$skiptoken=20

500,000product records

20 products +link to next page

500,000product records

Page 21: Введение в  ADO.NET Data Services

Friendly FeedsFriendly Feeds

Title?

Author?

Atom Pub (APP)Entry Document

Page 22: Введение в  ADO.NET Data Services

BLOB StreamsBLOB Streams

Base64 String

Page 23: Введение в  ADO.NET Data Services

BLOB StreamsBLOB Streams/Products(1)/Photo

Photo Metadata

/Products(1)/Photo/$value

Photo Image

Page 24: Введение в  ADO.NET Data Services

WPF Data BindingWPF Data Binding

Data ServiceEntity

WPFFramework

Element2. Bind data to control

3. Modify data within control

Data ServiceContext

1. R

etr

ieve d

ata

4. Notify context of the change

Page 25: Введение в  ADO.NET Data Services

WPF Data BindingWPF Data Binding

Data ServiceEntity List

WPF ItemsControl

2. Bind data to control

3. Modify data within control

Data ServiceContext

1. R

etr

ieve d

ata

4. Notify context of the change


Recommended