asp.net core mvc tutorial code example

Example 1: main concepts in asp.net core

13 features to build better applications with ASP.NET Core
Cross-platform & container support. ...
High performance. ...
Asynchronous via async/await. ...
Unified MVC & Web API frameworks. ...
Multiple environments and development mode. ...
Dependency Injection. ...
WebSockets & SignalR. ...
Cross-Site Request Forgery (CSRF) Protection.

Example 2: dotnet core webapp

dotnet new webApp -o myWebApp --no-https
cd myWebApp
dotnet run

#Open Pages/Index.cshtml in any text editor and replace all of the code with the following,
#then save the file.

Example 3: dotnet core webapp

@page
@model IndexModel
@{
    ViewData["Title"] = "Home page";
}

<div class="text-center">
    <h1>Hello, world!</h1>
    <p>The time on the server is @DateTime.Now</p>
</div>