CodeCamp Iasi 10 March 2012 - Gabriel Enea - ASP.NET Web API

Post on 18-Nov-2014

2.726 views 0 download

Tags:

description

 

Transcript of CodeCamp Iasi 10 March 2012 - Gabriel Enea - ASP.NET Web API

ASP.NET Web API in 30 minGabriel ENEAMaxcode@dotnet18 / gabrielenea.blogspot.com

10 march 2012

Agenda Background Web API overview, concepts, elements, architecture

if (codecamp.AvailableTime) { // run some demos me.Run.Demo1(); me.Run.Demo2(); } else { throw new UsualTimeoutException(); }

Server vs. Client side UI processing

WebForms, 2002MVC, 2009

?, 2012

0

10

20

30

40

50

60

70

80

90

100

ClientServer

WebAPI

What is ASP.NET Web API?

A framework that makes it easy to build HTTP services that reach a broad range of clients, including

browsers and mobile devices.

Web API target: any device

One ASP.NET Scott Hanselman (hanselman.com)

Web API is built around…

URI - Uniform Resource Identifier HTTP communication protocol HTTP methods (GET, PUT, POST, and DELETE) 

Do you love me ASP.NET MVC ?

No, I love ASP.NET Web API Uses common concepts from ASP.NET MVC

ControllersRoutingModelModel BindingModel ValidationFiltersDependency InjectionSecurity

+HTTP content negotiation

More about ASP.NET Web API Uses common concepts from ASP.NET MVC

ControllersRoutingModelModel BindingModel ValidationFiltersDependency InjectionSecurity

+HTTP content negotiation

Web API - Routing

Based on a routing table, each HTTP message is mapped to an action.

Uses HTTP method name to select an action!

1st demo

Comments management

HTTP Message Handlers

Pipeline for processing HTTP messages on both the client and server.

src: http://blog.highwaterfilters.com/epa-wants-more-analysis-on-keystone-oil-sands-pipeline/

HTTP Message Handlers

Built on some common objects:

HttpRequestMessage

HttpResponseMessage

HttpMessageHandler

HTTP Message Handlers on Client - 1

HTTP Message Handlers on Client - 2

HTTP Message Handlers on Client - 3

HTTP Message Handlers on Server

More features - ASP.NET Web API Async support OData support Self-Host Media Formatters (built-in support for XML, JSON, and form-url encoded data)

2nd demo

Client + Server in memory

ASP.NET Web API in 30 min

No questions!?

ASP.NET Web API - Resources

www.asp.net/web-api

ASP.NET Web API in 30 minGabriel ENEAMaxcode@dotnet18 / gabrielenea.blogspot.com

10 march 2012

src: http://idowindows.wordpress.com/2011/10/15/welcome-and-thank-you/

Pls. fill your eval. form