Introduction to .NET Core

Every developer familiar with back-end development have at least heard about .NET technologies. Use of C# with .NET Framework is known as direct competition with Java. In this competition some prefer Java over C# because Java have more mobility where it could be used in Windows, Linux or MacOS. Even though it is feasible to provide Linux and MacOS support to .NET Framework, Microsoft have focused on Windows support and .NET framework is currently run on Windows platform.

“Develop high performance applications in less time, on any platform.” — .NET Core

Let’s get started

Windows installation of .NET Core is quite straight forward. This could be also installed in Ubuntu, Debian and MacOS without much hazel using installation page.

dotnet new console --framework netcoreapp1.1
dotnet restore
dotnet run

What’s ASP.NET Core?

If you’re familiar with .NET Framework it is certain that you have came across ASP.NET too. Simply it’s web framework using .NET Framework and is equipped to work with HTML, and JavaScript. So ASP.NET Core is kind of compact version of ASP.NET and is based on .NET Core rather than .NET Framework.

ASP.NET Empty File Structure
ASP.NET Empty: Program.cs
ASP.NET Empty: Startup.cs -> Configure()
Controllers/ValuesController.cs

Is it possible to use Angular or React?

Being web framework ASP.NET Core should be able to work with SPA (single page applications) to create web pages. Most of back-end services provide their own template tools which would be headache for JavaScript developer. Rather many developers prefers to use popular MV* Frameworks such as Angular or React(with Redux) to manage web pages within ASP.NET Core.

dotnet new --install Microsoft.AspNetCore.SpaTemplates::*dotnet new reactredux
dotnet restore // Run 'npm install' for some templates
dotnet run
New templates added
File structure for reactredux template

Need to run NodeJS too?

Luckily ASP.NET Core also provides nuget package to match your need: Microsoft.AspNetCore.NodeServices, enabling run node.js inside server and to use npm packages even at .NET Core run-time.

What is Docker support?

You might have noticed about docker installation process give in .NET Core installation page. Simply Docker is a container solution used to avoid any complication in setting up the environment. With probably constructed Dockerfile anyone can make the same environment in any machine, and this is pretty important when working in groups. (Some familiarity with docker is anticipated for following code segments)

Dockerhub
docker run -it microsoft/dotnet:latestdotnet new console -o myApp
cd myApp
dotnet restore
dotnet run
dotnet new webapi -o dockerApp 
// Create ASP.NET Core WebAPI application inside ./dockerApp
cd dockerApp
dotnet restore
dotnet run
dotnet publish -c Release -o out

// Production .dll files added to ./out

docker build -t dockerapp .
// Build docker image from 'dockerfile'
docker run -it --rm dockerapp
// Run newly created docker container

Entity Framework Core too?

.NET Framework surrounding eco-system is always Entity Framework. Microsoft have matched .NET Core also with light weight EF Core to be used for data access. EF Core 2.0 is currently being built to align with .NET Standard as well as .NET Core 2.0.

Some useful GitHub repositories

Full Stack Developer | BiBi

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store