Introduction to Asp.net Core 1.0

I had a privilege to be invited by Agile Testing Alliance , Vadodara chapter to talk about Asp.net Core 1.0 . It was very interactive sessions and the participants asked some really good questions.

Here is the synopsis of my talk

What is Asp.net Core ?

It is a lean stack from Microsoft to develop the modern web apps built from ground up and is most revolutionary version since asp.net first was released in 2002
Today it is available RC1 update 1 which comes with golive license so this means that this framework is production ready.

Cross platform

This is a game changer and USP about this framework.  It works seamlessly on Windows, OSX and Linux. The same code base runs directly on the metal, and remember this is different from the Mono Framework. In fact the CoreClr is around 11 meg and is shipped along with your application as a nuget package

Unified programming model

In previous versions of MVC 5 and webapi 2 each API existed in different namespaces but there are now one. So if you remember in previous version of mvc you need to inherit the class from the controller and when you need to develop a webapi you need to inherit from apicontroller. But now everything comes under one controller class. same applies to routing, actions, filters etc.

Modular components

Every feature now is shipped as a single nuget package. So if you want to use mvc features download it and register as middleware, You want identity authentication do the same and you are up and running. ConfigureServices where your register your middleware services and Configure is where you use them.  You can write your own custom middleware too.The sample code below give you fair idea of these methods

Middleware and built in Ioc

In previous versions of aps.net DI and IOC were optional but now it is part of the framework and it comes as a built in feature out of the box. You are free to replace it with your own favourite DI framework too.

Modern tooling

You can take the advantage of all the modern tooling which JavaScript world supports, In fact bower can be used for all client side packages whereas nuget can take care of server side packages and dependencies. Use Gulp or Grunt for task runners. Remember that in the older versions you had bundling and minification feature in mvc this is no more there now and it is replaced by this task runners to care of it

DNX context

 

DNX stands for Dot net Execution. The DNX and middleware works in hand to hand to process the request pipeline. Below diagram represents the complete picture.

image

Actually, when the request is made, it first arrives at the web server,web server then invokes the DNX which will load the CLR and then looks for an entry point, the Main method, in your application and executes it. The main method configures the pipeline by using the Startup class, and the request is pushed through the pipeline, processed by the middleware which will produce the response.

Cloud Optimized

As it has low footprint deployment it is your best choice for cloud based solutions.

Github OSS

 

We all know that Microsoft has embrace the OSS in a big way and asp.net core is no more different. If you wish to contribute to this you can very well do it. Just create a pull request or fork it on Github. There are really some very good contributions from community.

Easy install

get.asp.net site is a single source of truth for asp.net core. Right from documentation to tools everything is available here. It is quite smart to recognize your OS version and suggest the appropriate download link.

Multiple choice of IDEs

Though I gave the demo on Visual studio. You have plethora choice for IDE like Code , Atom and many others.

Presentation materials

The sample demo application and slide decks can be downloaded from my Github repo. I’ve heard that recording has also been done. I would check out with the organizers and will upload later once it is available to me.