asp.net core introduction - dnn-connect.org · what is asp.net core 1.0 (aka asp.net 5 aka asp.net...

18
#DNNConnect2016 ASP .Net Core Introduction Sebastian Leupold dnnWerk Germany [email protected]

Upload: others

Post on 06-Jun-2020

41 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

ASP.Net Core Introduction

Sebastian Leupold

dnnWerk Germany

[email protected]

Page 2: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

Please support our valuable sponsors

Page 3: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

Agenda

• What is ASP.Net Core

• Components

• First Application

• Simple MVC Application

• Consequences• Hosting

• Development

• DNN

Page 4: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

ASP.Net Core 1.0

Page 5: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext)

• New Stack for Web Development

• Cross Platform (Windows, Linux, Mac)

• Open Source

• Following OWIN concept (Open Web Interface for .Net)

• Based on .Net Core 1.0 or .Net Framework 4.6

• Smaller Server Footprint

• Includes Web Server and Application

Page 6: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

.Net Core

ASP.NET Core

App Model

Universal Windows Apps Model

Any other

app model

Unified BCL

(Base Class Library)

Runtime Adaption Layer

.NET Native

and RuntimeCore CLR Other Runtime

Page 7: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

.Net Core 1.0

• New Implementation

• App Level isolation

• For Modern Apps and Web

• Subset of .Net 4.6, 100% compatible

• .Net Core 1 Applications runs on .Net 4.6 – not vv.

• Modular and smaller, optimized for specific workloads

• Set of NuGet Packages (included in App)

• Side by side install (instead of shared framework)

• No support for WebForms, WinForms, WPF, Windows specifics

Page 8: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

DotNet Core CLI

• Use DotNet CLI

• dotnet new Scaffold a minimal application

• dotnet restore Restores packages for the project

• dotnet run Compiles and runs the application

• dotnet build Compiles to IL

• dotnet build native Compiles to a single executable

• dotnet dosomething You can build your own commands

Page 9: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

ASP.Net Core

.NET Framework 4.6 .NET Core 1.0Full .NET Framework for any scenario and

library support on Windows

Modular libraries & runtime optimized for

server and cloud workloads

Page 10: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

ASP.Net Core

• Demo

Page 11: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

Building ASP.Net

Code(my.cs)

References (Modular, NuGet)

JIT Compiler(RyuJIT)

Page 12: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

MVC & Web API – the important pieces

• Startup, Middleware pipelineRouting, authentication, static files, diagnostics, error handling, session, CORS, custom

• Configurationproject.json, config.json, package management (NuGet, npm), tasks runners (gulp)

• Models, Controllers, ViewsData (EF7), web methods, tag helpers

• Web ListenersWeb (Windows), Kestrel (cross-plat), IIS

Page 13: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

ASP.Net Core

• Demo

Page 14: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

Entity Framework Core 1.0 (aka EF 7)

EF Core: New Development• Cross Platform• Supports

• Microsoft SQL Server

• SQLite

• Postgres (Npgsql)

• SQL Server Compact Edition

• InMemory (for testing purposes)

• MySQL

• IBM DB2

• Basic Modelling based on POCO• LINQ• Basic Save with Change Tracking• Database schema management• Not all features of EF 6 in EF Core 1.0!

Page 15: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

Benefits

• New options for web development from ground

• Cloud optimized

• Faster websites

• Smaller Memory Footprint• More efficient use of web servers

Page 16: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

Consequences for DNN Developers

• DNN ??

• Can a CMS follow the principles of .Net Core?• Would be necessary for speed

• Reduce resource consumption

• Stay up2date with web development

Page 17: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

Getting Started / Links

https://dotnet.github.io/core

www.asp.net https://docs.asp.net

https://github.com/aspnet

Page 18: ASP.Net Core Introduction - dnn-connect.org · What is ASP.Net Core 1.0 (aka ASP.Net 5 aka ASP.Net vNext) •New Stack for Web Development •Cross Platform (Windows, Linux, Mac)

#DNNConnect2016

Questions?

Please remember to evaluate the session online

Thank you