@alexbeletsky
http://beletsky.net
What's new in ASP.NET 4.5?
One ASP.NET Framework
ASP.NET MVC 4 Release
ASP.NET WebForms Improvements
ASP.NET Web Pages 2 (Web Matrix)
SignalR
ASP.NET Web API (ex. WCF Web API)
Open Source
Slide 4
Slide 4 text
@alexbeletsky
http://beletsky.net
What's new in ASP.NET 4.5?
One ASP.NET Framework
ASP.NET MVC 4 Release
ASP.NET WebForms Improvements
ASP.NET Web Pages 2 (Web Matrix)
SignalR
ASP.NET Web API (ex. WCF Web API)
Open Source
Slide 5
Slide 5 text
@alexbeletsky
http://beletsky.net
Early days of API oriented apps
/GetOrders
/GetOrders
/UpdateOrder
/GetAllDueOrders
/DeleteOrder.asmx?id=1
/UpdateOrder.asms?id=1&title=”New”...
Slide 6
Slide 6 text
@alexbeletsky
http://beletsky.net
RPC
Remote Procedure Call
The architecture style, where client sends a request
to remote server and execute specified procedure
with optional parameters.
Slide 7
Slide 7 text
@alexbeletsky
http://beletsky.net
SOAP, WSDL, UDDI
WS-*
Finally considered to be...
Slide 8
Slide 8 text
@alexbeletsky
http://beletsky.net
… evil
Slide 9
Slide 9 text
@alexbeletsky
http://beletsky.net
RESTful based API
GET /orders
GET /orders/1
POST /orders
PUT /orders/1?title=”New”
DELETE /orders/1
Slide 10
Slide 10 text
@alexbeletsky
http://beletsky.net
REST
Representational State Transfer
The architecture style, where communication
between client and server relys on HTTP standard
and uses lightweight mechanisms for transporting
data
Slide 11
Slide 11 text
@alexbeletsky
http://beletsky.net
REST, JSON, VERBS
Finally considered to be...
Slide 12
Slide 12 text
@alexbeletsky
http://beletsky.net
Slide 13
Slide 13 text
@alexbeletsky
http://beletsky.net
What is ASP.NET Web API?
Framework for build REST style API services,
providing best practices and features of REST
services inside the box.
Slide 14
Slide 14 text
@alexbeletsky
http://beletsky.net
But I got used
to build REST API with
ASP.NET MVC?
Slide 15
Slide 15 text
@alexbeletsky
http://beletsky.net
ASP.NET MVC vs. ASP.NET WEB API
ASP.NET MVC is positioned as page-oriented
development framework.
ASP.NET Web API is positioned as api-oriented
development framework.
Slide 16
Slide 16 text
@alexbeletsky
http://beletsky.net
ASP.NET WEB API
One service – many
clients
Slide 17
Slide 17 text
@alexbeletsky
http://beletsky.net
ASP.NET Web API main features
- Code Scaffolding
- Content Negotiation
- MediaTypeFormatters
- Hypermedia
- IQueryable & Odata support
- Self-Documenting API
- Hosting Options
Slide 18
Slide 18 text
@alexbeletsky
http://beletsky.net
Quick Example: ASP.NET Mobile App
Slide 19
Slide 19 text
@alexbeletsky
http://beletsky.net
Code Scaffolding
- Scaffolds for Code-First Entity Framework
- Easy to use
- Great for quick start and prototyping
- CRUD from the box
Slide 20
Slide 20 text
@alexbeletsky
http://beletsky.net
Content Negotiation
- Find best match between client-server
- Uses HTTP header information
- “Invisible” for developer
- JSON, XML from the box
Slide 21
Slide 21 text
@alexbeletsky
http://beletsky.net
Media Type Formatters
- For support any custom API format
- Based on async operations
- BufferedMediaTypeFormatter wraps the
asynchronous read/write methods inside
sychronous methods.
Slide 22
Slide 22 text
@alexbeletsky
http://beletsky.net
Hypermedia Support
- Flexibility of formats
- HttpResponseMessage class
- Embrace correct HTTP status codes
Slide 23
Slide 23 text
@alexbeletsky
http://beletsky.net
IQueryable & OData support
- Paging and sorting from the box
- OData functions: $top, $order, $skip, $filter
Slide 24
Slide 24 text
@alexbeletsky
http://beletsky.net
Self Documenting API
- IApiExplorer interface for getting info
- ApiDescription encapsulates information about
particual API class
- Used to generate documentation pages
Slide 25
Slide 25 text
@alexbeletsky
http://beletsky.net
Hosting Options
- ASP.NET hosting by default
- Self Hosting (HTTP server in .exe)
- OWIN, Kayak
- Azure Roles