Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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 ✓ ✗ ✗

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

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