ASP.NET Core Demos

of 18/18
ASP.NET CORE QUICK START
  • date post

    21-Mar-2017
  • Category

    Software

  • view

    111
  • download

    1

Embed Size (px)

Transcript of ASP.NET Core Demos

PowerPoint Presentation

ASP.NET Core Quick start

Erik Noren

Solutions ArchitectSoftware Developer 15+ YearsSoftware Tinkerer Since Commodore 64Hardware HobbyistTwitter: @ErikNorenGitHub: ErikNoren

ASP.NET Core Quick start.NET Core or .NET Framework

ASP.NET Core on

.NET FrameworkEasy to Add Project ReferencesWindows OnlyCreate Libraries as Class Library.NET CorePrimarily Leverage NuGet PackagesCross PlatformStart with Portable Class Library then convert to .NET Standard

ASP.NET CoreDeveloped the same regardless if you choose .NET Core or .NET Framework.NET Core and .NET Framework dont have feature parity so some differences thereIs a Console Application with a built-in web server (Kestrel)Integrates Dependency Injection in a smart way and takes advantage of knowing DI is available from the start.Heavy use of NuGet packages and separation of abstractions from implementation make DI into class libraries easy.

ASP.NET Core Quick startConfiguration

ConfigurationMultiple Providers for Different SourcesJSON Files, Environment Variables, INI Files, XML Files, Command Line SwitchesConfiguration Values Stored in Single IConfiguration ObjectConfiguration Sources Converted to Key Value PairsKey Names are Flattened Hierarchy Using Colon DelimitersKeyKey:SubKey:AnotherSubKeyBind Configuration to POCO Object for Easy Use

ConfigurationSource{ Version: 1.0.preview1, Build : { Target: Release, Date: 2017-02-16 }}IconfigurationVersion = 1.0.preview1Build:Target = ReleaseBuild:Date = 2017-02-16

ConfigurationAdded to DI Container as SingletonIOptionsIOptionsSnapshotIOptionsMonitorservices.Configure()Settings at time of application startSettings as they currently are*Settings as they currently are***Provider must support ReloadOnChange. Available in version 1.1.0**Provider must support ReloadOnChange. Has change event you can hook to detect changes.

ASP.NET Core Quick startConfiguration Demo

ASP.NET Core Quick startLogging

LoggingILoggerFactory can be injected to set up and configure loggingILogger can be injected in constructors to log messagesILogger comes from Microsoft.Extensions.Logging.AbstractionsEasy to include into other projects using the interfaceDependency Injection will inject the implementation from the applicationAvoid circular references, shared classes, etc.Change logging provider in container with no application code changes

ASP.NET Core Quick startLogging Demo

ASP.NET Core Quick startClass Library References

Class Library References

Separating logic into separate projects is common.NET Framework projects continue to work as they always have.NET Core requires Portable Class Libraries targeting .NET StandardNuGet Packages can contain both .NET Framework and .NET Core libsTo see if a NuGet package is compatible, look at its dependencies.NET Framework 4x will work in ASP.NET Core using .NET Framework.NET Standard 1.x will work in ASP.NET Core using .NET Core

ASP.NET Core Quick startClass Library References Demo

QUESTIONS?

Erik NorenSolutions ArchitectSoftware Developer 15+ YearsSoftware Tinkerer Since Commodore 64Hardware HobbyistTwitter: @ErikNorenGitHub: ErikNoren

ResourcesDemo Code Samples - https://github.com/ErikNoren/AspNetCoreDemosASP.NET Core https://www.asp.net/coreASP.NET Core Source https://github.com/aspnet/homeMicrosoft Docs https://docs.microsoft.com/.NET Standard https://github.com/dotnet/standard.NET Core Roadmap https://github.com/dotnet/core/blob/master/roadmap.md.NET Foundation https://dotnetfoundation.org/