Your SlideShare is downloading. ×
WCF ASP.NET Web API// Round-UpAlexander Zeitler
Alexander Zeitlerblog.alexonasp.net | @AlexZeitler
?
http://www.asp.net/web-api Only one HTTP / ReST / Hypermedia API Fx from MS „Best of both worlds“
WCF to ASP.NET Web API    WCF Web API              ASP.NET Web API    Service                 Web API controller    Opera...
WCF to ASP.NET Web API ApiController (!=Controller, no common BaseClass) ASP.NET Routing (MapHttpRoute)    Convention o...
WCF to ASP.NET Web API Safe for production?                         http://stackoverflow.com/questions/9402034/start-deve...
Demo | File | New | WebAPI
Demo | ContactsWeb
Demo | CommentsWeb
Node-style Web API? WTF?LiteWebServer server = new LiteWebServer("http://localhost");server.Get("/Hello", (r) => new HttpR...
Async FTW!     http://www.tugberkugurlu.com/archive/my-take-on-task-base-asynchronous-programming-in-c-sharp-5-0-and-asp-n...
Logging with ELMAHpublic class ElmahErrorAttribute :    System.Web.Http.Filters.ExceptionFilterAttributeprivate void Confi...
ASP.NET Web API | Ressources http://www.asp.net/web-api http://blogs.msdn.com/b/henrikn/ http://weblogs.asp.net/scottg...
http://www.flickr.com/photos/crystaljingsr/3914729343/
http://www.flickr.com/photos/nateone/3768979925
Upcoming SlideShare
Loading in...5
×

ASP.NET Web API Round-Up @noug

5,727

Published on

Slides for my Online Usergroup talk on 27th february 2012 about the new ASP.NET Web API from Microsoft.
http://online-usergroup.de/termine.20120227.ashx

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
5,727
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "ASP.NET Web API Round-Up @noug"

  1. 1. WCF ASP.NET Web API// Round-UpAlexander Zeitler
  2. 2. Alexander Zeitlerblog.alexonasp.net | @AlexZeitler
  3. 3. ?
  4. 4. http://www.asp.net/web-api Only one HTTP / ReST / Hypermedia API Fx from MS „Best of both worlds“
  5. 5. WCF to ASP.NET Web API WCF Web API ASP.NET Web API Service  Web API controller Operation  Action Service contract  - Endpoint  - URI templates  ASP.NET Routing Message handlers  Same Formatters  Same Filters, model Operation handlers  binders
  6. 6. WCF to ASP.NET Web API ApiController (!=Controller, no common BaseClass) ASP.NET Routing (MapHttpRoute)  Convention over Configuration Web API to go / NuGet Packages  Web API hosted in ASP.NET: AspNetWebApi  Self-hosted Web API: AspNetWebApi.Selfhost  HttpClient including XML and JSON formatters: System.Net.Http.Formatting  JsonValue for navigating and manipulating JSON: System.Json Go Live License
  7. 7. WCF to ASP.NET Web API Safe for production? http://stackoverflow.com/questions/9402034/start-developing-with-mvc4-web-api-today-using-beta
  8. 8. Demo | File | New | WebAPI
  9. 9. Demo | ContactsWeb
  10. 10. Demo | CommentsWeb
  11. 11. Node-style Web API? WTF?LiteWebServer server = new LiteWebServer("http://localhost");server.Get("/Hello", (r) => new HttpResponseMessage() { Content = new StringContent("Hello World!")});server.Post("/Echo", (r) => new HttpResponseMessage() { Content = new StringContent( r.Content.ReadAsStringAsync().Result )});server.Open(); http://blogs.msdn.com/b/youssefm/archive/2012/02/24/writing-a-lightweight-web-service-using-webapi-building-blocks.aspx
  12. 12. Async FTW! http://www.tugberkugurlu.com/archive/my-take-on-task-base-asynchronous-programming-in-c-sharp-5-0-and-asp-net-mvc-web-applications
  13. 13. Logging with ELMAHpublic class ElmahErrorAttribute : System.Web.Http.Filters.ExceptionFilterAttributeprivate void Configure(HttpConfiguration httpConfiguration) { httpConfiguration.Filters.Add( new ElmahErrorAttribute() ); httpConfiguration.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); } http://www.tugberkugurlu.com/archive/asp-net-web-api-and-elmah-integration
  14. 14. ASP.NET Web API | Ressources http://www.asp.net/web-api http://blogs.msdn.com/b/henrikn/ http://weblogs.asp.net/scottgu/archive/tags/Web+API /default.aspx http://stackoverflow.com/questions/tagged/asp.net- web-api https://github.com/ChristianWeyer/Thinktecture.Web. Http http://blog.alexonasp.net http://aspnet.uservoice.com/forums/147201-web- api/suggestions/2618312-allow-for-non- asynchronous-calls-to-the-web-api
  15. 15. http://www.flickr.com/photos/crystaljingsr/3914729343/
  16. 16. http://www.flickr.com/photos/nateone/3768979925

×