Diving into the Deep With ASP.NET

Diving into the Deep With ASP.NET

A talk I gave at Twin Cities Code Camp on April 27, 2013. I talked about various Web API topics and shared code from my closed source project, Keep Track of My Games (http://keeptrackofmygames.com).

The notes and links can be found in this post: http://kamranicus.com/Blog/Posts/73/slides-and-resources-for-tccc14-web-api-talk

B924bc0147903cbd7a4506d7d26ab328?s=128

Kamran Ayub

April 27, 2013
Tweet

Transcript

  1. 1.

    DIVING INTO THE DEEP WITH ASP .NET WEB API @kamranayub

    Cannonball - Luis Martins, from The Noun Project
  2. 2.
  3. 3.

    < > gaming coding Attribution: Code - Nikhil Dev,, Video

    Game Controller - 42, Batman - Ilias Ismanalijev, French Fries - Stephanie Wauters, - from The Noun Project metal-ing learning eating *i wish. vigilante-ing*
  4. 4.
  5. 6.

    TOPICS FOR DISCUSSION Debugging & Performance Logging Dependency Injection Authorization

    & Authentication Anti-Forgery Custom Routing Exception Handling Async Tasks Multi-Platform Consumption Versioning
  6. 10.
  7. 14.

    HTTP Authorization Web API supports action filters just like MVC

    In this case, I’ve implemented a custom System.Web.Http.AuthorizeAttribute named HttpRequireProfile that checks my database for the logged-in user
  8. 21.
  9. 22.

    public async Task ViewPresentation() { return await _presenter.IsFunny(); } (Like

    that’ll ever finish executing amirite) Doesn’t serve a “real” purpose Generates a state machine NOT void* *except in certain cases
  10. 24.
  11. 28.

    3 users 60 second load ~7000 requests Async makes a

    difference. About 36% in this instance, but not every call benefits from awaiting. Sync Async Difference # Requests 4354 6890 +36% Avg Requests/s 71.59 113 +36% Avg Response (ms) 42ms 26ms -61%
  12. 30.

    And let’s not forget C#! Yes, that’s 5 lines of

    actual code! No configuration No XML No WCF
  13. 32.

    Someone also wants to add semantic versioning to Attribute Routing

    (no, it wasn’t me) Not sure about Web API support, though (Maybe I’ll go add it…)
  14. 34.

    Recommended Libraries • Javascript • Underscore.js • TrafficCop.js • Knockout.js

    • Moment.js or Date.js • URI.js • .NET • Attribute Routing • DotNotOpenAuth (or WorldDomination.Web.Auth) • Common Logging • Ninject • ActionMailer • Cassette • FluentValidation • MiniProfiler • PerfIt • Westwind.RazorHosting
  15. 35.

    Thanks! Hopefully you learned a thing or two about using

    Web API I also hope you saw how awesome it is, even with complex problems @kamranayub kamranicus.com