Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ASP.NET MVC 5 vs ASP.net Web API 2 vs ASP.NET Core MVC 1

ASP.NET MVC 5 vs ASP.net Web API 2 vs ASP.NET Core MVC 1

Internal Lightning Talk @ Redgate, Cambridge, UK

Tugberk Ugurlu

November 01, 2016
Tweet

More Decks by Tugberk Ugurlu

Other Decks in Programming

Transcript

  1. ASP.NET MVC 5
    vs.
    ASP.NET Web API 2
    vs.
    ASP.NET Core MVC 1
    Tugberk Ugurlu
    @tourismgeek

    View full-size slide

  2. ASP.NET MVC 5
    “A framework for writing server-side rendered Web applications
    based on Model-View-Controller pattern.

    View full-size slide

  3. ASP.NET MVC 5
    CTP was on 2007
    http://www.wrox.com/WileyCDA/WroxTitle/Professional-ASP-NET-MVC-3.productCd-1118076583.html

    View full-size slide

  4. ASP.NET MVC 5
    V1 was on 2009
    Latest version is 5.2.3
    which shipped on
    9th of February
    Tied to IIS in terms of
    hosting
    Does not work on CoreCLR

    View full-size slide

  5. ASP.NET MVC 5: It’s good when you
     Need server-side rendering capabilities
     Doesn’t have a need for hosting outside of IIS

    View full-size slide

  6. ASP.NET Web API 2
    “A framework which is optimized for creating HTTP APIs.

    View full-size slide

  7. ASP.NET Web API 2
    V1 was on 2012
    Latest version is 2.2 (5.2.3)
    which shipped on
    9th of February
    Can be hosted
    outside of IIS
    (HttpListener, any server
    compatible with OWIN, etc.)
    Can work on Mono
    (if you accept the fact that
    you will hit weird bugs)
    Has a very natural HTTP
    programming model

    View full-size slide

  8. ASP.NET Web API: It’s good when you
     Need a framework to put together some HTTP APIs
     Doesn’t have a need for hosting outside of Windows or OK to deal
    with mono

    View full-size slide

  9. ASP.NET MVC Core 1
    “A unified framework which both has MVC and Web API programming
    models on top of ASP.NET Core.

    View full-size slide

  10. ASP.NET MVC Core 1
    V1 was on 2016, June
    (latest version is 1.0.1)
    Actively developed and
    maintained
    Can be hosted
    outside of IIS
    Can run on CoreCLR
    On top of ASP.NET Core
    programming model
    Runs on Kestrel web
    server, based on Libuv

    View full-size slide

  11. ASP.NET MVC Core 1: Little things
    • Logging: https://github.com/aspnet/Logging
    • Configuration: https://github.com/aspnet/Configuration
    • Options: https://github.com/aspnet/Options
    • New Data Protection APIs: https://docs.asp.net/en/latest/security/data-protection/index.html

    View full-size slide

  12. ASP.NET MVC Core 1: Some causion
    “Don’t expose Kestrel web server directly to public, stick it behind a
    proper web server like IIS, NGINX as reverse proxy

    View full-size slide

  13. ASP.NET MVC Core 1: It’s good when you
     Need a server-side framework to write any sort of web applications
     Need to be able to host outside of Windows
     Want to take advantage of new ASP.NET Core programming model
     OK to occasionally pull your hair out

    View full-size slide

  14. Compression Summary
    ASP.NET MVC Core 1 ASP.NET Web API 2 ASP.NET MVC 5
    Active development ✓ ✗ ✗
    Good for server-side rendering ✓ ✗ ✓
    Good for HTTP APIs ✓ ✓ ✗
    Can be hosted outside of IIS ✓ ✓ ✗
    Can run on CoreCLR ✓ ✗ ✗

    View full-size slide

  15. Conclusions
    • Microsoft sucks on naming and versioning things
    • Use ASP.NET MVC Core if you are OK to run on CoreCLR
    • Stick with others if you cannot run on CoreCLR

    View full-size slide

  16. Resources
    • ASP.NET Core MVC Repository: https://github.com/aspnet/Mvc
    • ASP.NET Web API and MVC Repository: https://aspnetwebstack.codeplex.com/
    • ASP.NET Core Docs: https://docs.asp.net
    • Some ASP.NET Core Samples: https://github.com/tugberkugurlu/AspNetCoreSamples

    View full-size slide