Successfully reported this slideshow.
WebApi vs MVC
About
Chaowlert C.
Production WebApi experience on
- Samsung Gift
- AIS Privilege
- InSing (SingTel Social)
Overview
WebApi
- Provide REST service
- Backend for Mobile
Device
- Backend for JavaScript
MVC
- Provide Web Page
MVC vs WebApi
MVC WebApi
Model View
HTML
Model
Content
Negotiatio
n
Result
Content Negotiation
- Return format from request
- Get format from header, querystring,
extension, and more
- Built-in sup...
Content Negotiation 2
- Accept various input formats from request
- Built-in support for url encoded, json, xml,
bson
Queryable / OData
- Query from result set
- $top, $skip, $select, $orderby, $inlinecount,
$filter, $expand
- Query operati...
Auto resolve action
- Match action without explicitly define
- Your url will comply to REST convention
GET /api/product/{i...
Exception
- Exception is data not html
- Http Status Code will tell you error category
400: wrong parameter
401: not login...
Html Help Page
- Create help pages instantly
- Utilize xml comments from your codes
Control over Http Pipeline
- Alter Http Request and Response
- Control over content
- Push stream content
- Byte range con...
More!!!
- CORS support (cross domain request)
- Support Batch operation
- Not need to host on IIS, WebApi is portable
Thank you
This event sponsored by
And we are hiring!
Upcoming SlideShare
Loading in …5
×

Web Api vs MVC

941 views

Published on

This presentation provides overview of new asp.net web api, comparing with MVC, and go through features of web api such as Content Negotiation, Queryable, Html help page, and more.

Published in: Software, Technology
  • Be the first to comment

Web Api vs MVC

  1. 1. WebApi vs MVC
  2. 2. About Chaowlert C. Production WebApi experience on - Samsung Gift - AIS Privilege - InSing (SingTel Social)
  3. 3. Overview WebApi - Provide REST service - Backend for Mobile Device - Backend for JavaScript MVC - Provide Web Page
  4. 4. MVC vs WebApi MVC WebApi Model View HTML Model Content Negotiatio n Result
  5. 5. Content Negotiation - Return format from request - Get format from header, querystring, extension, and more - Built-in support for json, xml, bson - You can create your own format ie. csv, atom, protobuf.net
  6. 6. Content Negotiation 2 - Accept various input formats from request - Built-in support for url encoded, json, xml, bson
  7. 7. Queryable / OData - Query from result set - $top, $skip, $select, $orderby, $inlinecount, $filter, $expand - Query operation is done from database
  8. 8. Auto resolve action - Match action without explicitly define - Your url will comply to REST convention GET /api/product/{id} for retrieve POST /api/product for insert PUT /api/product/{id} for update DELETE /api/product/{id} for delete
  9. 9. Exception - Exception is data not html - Http Status Code will tell you error category 400: wrong parameter 401: not login 403: no authorize 404: not found ...
  10. 10. Html Help Page - Create help pages instantly - Utilize xml comments from your codes
  11. 11. Control over Http Pipeline - Alter Http Request and Response - Control over content - Push stream content - Byte range content - or your own
  12. 12. More!!! - CORS support (cross domain request) - Support Batch operation - Not need to host on IIS, WebApi is portable
  13. 13. Thank you This event sponsored by And we are hiring!

×