SlideShare a Scribd company logo
ASP.NET CORE QUICK START
ERIK NOREN
Solutions Architect
Software Developer 15+ Years
Software Tinkerer Since Commodore 64
Hardware Hobbyist
Twitter: @ErikNoren
GitHub: ErikNoren
ASP.NET CORE QUICK START
Middleware
MIDDLEWARE
• Serve as the “pipeline” for handling requests
• Order of middleware is significant and should be carefully
considered
• Requests pass through middleware in the order defined and responses in
reverse order
• A single request cycle uses the same middleware class instance
• Data and information stored in member variables during request available
during response
• Each middleware component is responsible for passing on or short
circuiting
MIDDLEWARE
When a request comes in, instances of
the middleware components are
created as needed. Logic prior to
awaiting on the RequestDelegate is
thought of as reading the incoming
request. Logic after that point is
thought of as processing the
response. This is convention; really
you have access to both on either side
of the delegate.
A HttpContext object is passed from
one component to the next giving
each a chance to read, alter, or handle
a request. Middleware that can fully
handle a request does not have to
invoke the RequestDelegate. That
component becomes the last in the
MIDDLEWARE
• Dependency injection works as expected
• Configuring middleware should follow Options Pattern
• Define a “configuring action” to set parameters
• Ensures any pre-configuration is not lost by user creating new options
object
• Unambiguous on lifetime of options object
• Cleaner, more fluent style code
• Exception: 0 to 2 options is easier to pass as parameters; no extra options
class and action
• Not a hard rule, just a style guideline
ASP.NET CORE QUICK START
Middleware Demo
ASP.NET CORE QUICK START
Controllers
CONTROLLERS
• No separate controllers for View vs API actions
• Don’t have to use base class at all but provides convenient methods
• A single controller can serve data to API requests and HTML to browsers
• *Even though it can, that doesn’t mean it should
• Route configuration still available but attribute routing is becoming
more common
CONTROLLERS
• Web API HttpRequestMessage and HttpResponseMessage are gone
(Yay!)
• There is a shim available for people porting WebAPI code that used these
• Preference is either concrete type or IActionResult
• ASP.NET MVC Controllers are largely unchanged except new pipeline
for requests
• Returning a View performs the same search for pages as before
• Razor Views have new Tag Helpers (But that’s UI and outside the
scope of this talk!)
• HTML tag and attribute based – similar to AngularJS
ASP.NET CORE QUICK START
Controllers Demo
ASP.NET CORE QUICK START
Entity Framework Core
• Everything you’ve heard is true (probably)
• Complete rewrite
• New architecture
• Regression of capabilities
• Despite regressed functionality, the design is much more flexible with
more capability
• Providers allow LINQ to be translated for different data stores
• Relational database base classes and SQL Server already in place; non-relational
coming soon
• Developers aren’t concerned with how data gets persisted and restored when
ENTITY FRAMEWORK CORE
• In Memory Provider
• So great it deserved its own slide
• Developers doing code first can work independent of data stores
• Iterate on features without making database changes that affect others
• Faster cycle to make changes and see affect without modifying and restoring
database schema
• “Unit testing” becomes easier
• Most people are actually writing integration tests
• Database state is deterministic
• No need to reset database or worry about modifying others’ data
• It becomes necessary to seed data in order to test code but bad data is no longer
ENTITY FRAMEWORK CORE
ASP.NET CORE QUICK START
Entity Framework Core Demo
BONUS: VISUAL STUDIO 2017
TIPS
Project Dependencies &
Packages
• Adding a project reference to a project that creates a NuGet package:
• Making changes in the referenced project are reflected on recompile
• No need to generate the package, publish to repository, update NuGet in
dependent project
• When building dependent solution as package, referenced project DLLs are not
included
• Referenced project NuGet package is added as a dependency of dependent
solution’s package
• This tooling change makes it much easier to create Abstraction /
Contract packages
VISUAL STUDIO 2017: PROJECT PACKAGES
BONUS: VISUAL STUDIO 2017
TIPS
Project Dependencies & Packages
Demo
QUESTIONS?
Erik Noren
Solutions Architect
Software Developer 15+ Years
Software Tinkerer Since Commodore 64
Hardware Hobbyist
Twitter: @ErikNoren
GitHub: ErikNoren
RESOURCES
• Demo Code Samples - https://github.com/ErikNoren/AspNetCoreDemos
• ASP.NET Core – https://www.asp.net/core
• ASP.NET Core Source – https://github.com/aspnet/home
• Microsoft Docs – https://docs.microsoft.com/
• Julie Lerman, Fantastic Data & Entity Framework Resource –
http://thedatafarm.com/blog/
• Julie on Pluralsight –
https://www.pluralsight.com/search?q=julie+lerman&categories=aem-author

More Related Content

What's hot

ONAP on Vagrant
ONAP on VagrantONAP on Vagrant
ONAP on Vagrant
Victor Morales
 
Entity Framework Core 1.0
Entity Framework Core 1.0Entity Framework Core 1.0
Entity Framework Core 1.0
Senthil Kumar
 
Continuous integration
Continuous integrationContinuous integration
Continuous integrationLior Tal
 
Entity Framework 7: What's New?
Entity Framework 7: What's New?Entity Framework 7: What's New?
Entity Framework 7: What's New?
Ricardo Peres
 
Build PWA with Ionic Toolkit
Build PWA with Ionic ToolkitBuild PWA with Ionic Toolkit
Build PWA with Ionic Toolkit
Pavel Kurnosov
 
Meteor Angular
Meteor AngularMeteor Angular
Meteor Angular
Pavel Kurnosov
 
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesThreading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Lauren Yew
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5
mbaric
 
Serverless meetup - OpenWhisk overview and architecture
Serverless meetup - OpenWhisk overview and architectureServerless meetup - OpenWhisk overview and architecture
Serverless meetup - OpenWhisk overview and architecture
Sandeep Paliwal
 
How to setup a development environment for ONAP
How to setup a development environment for ONAPHow to setup a development environment for ONAP
How to setup a development environment for ONAP
Victor Morales
 
Javantura v4 - FreeMarker in Spring web - Marin Kalapać
Javantura v4 - FreeMarker in Spring web - Marin KalapaćJavantura v4 - FreeMarker in Spring web - Marin Kalapać
Javantura v4 - FreeMarker in Spring web - Marin Kalapać
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
Tin Linn Soe
 
UWP apps development - Part 2
UWP apps development - Part 2UWP apps development - Part 2
UWP apps development - Part 2
Jiri Danihelka
 
Migration from ASP.NET MVC to ASP.NET Core
Migration from ASP.NET MVC to ASP.NET CoreMigration from ASP.NET MVC to ASP.NET Core
Migration from ASP.NET MVC to ASP.NET Core
Miroslav Popovic
 
DDD and CQRS for .NET Developers
DDD and CQRS for .NET DevelopersDDD and CQRS for .NET Developers
DDD and CQRS for .NET Developers
Allan Mangune
 
Introduction to Continuous Integration
Introduction to Continuous IntegrationIntroduction to Continuous Integration
Introduction to Continuous Integration
Hùng Nguyễn Huy
 
Rethinking the debugger
Rethinking the debuggerRethinking the debugger
Rethinking the debugger
Iulian Dragos
 
Testing Microservices
Testing MicroservicesTesting Microservices
Testing Microservices
Anil Allewar
 
Brightcove presentation on Automated Testing
Brightcove presentation on Automated TestingBrightcove presentation on Automated Testing
Brightcove presentation on Automated Testing
MassTLC
 

What's hot (20)

ONAP on Vagrant
ONAP on VagrantONAP on Vagrant
ONAP on Vagrant
 
Entity Framework Core 1.0
Entity Framework Core 1.0Entity Framework Core 1.0
Entity Framework Core 1.0
 
Continuous integration
Continuous integrationContinuous integration
Continuous integration
 
Entity Framework 7: What's New?
Entity Framework 7: What's New?Entity Framework 7: What's New?
Entity Framework 7: What's New?
 
Build PWA with Ionic Toolkit
Build PWA with Ionic ToolkitBuild PWA with Ionic Toolkit
Build PWA with Ionic Toolkit
 
Meteor Angular
Meteor AngularMeteor Angular
Meteor Angular
 
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin CoroutinesThreading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
Threading Made Easy! A Busy Developer’s Guide to Kotlin Coroutines
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5
 
Serverless meetup - OpenWhisk overview and architecture
Serverless meetup - OpenWhisk overview and architectureServerless meetup - OpenWhisk overview and architecture
Serverless meetup - OpenWhisk overview and architecture
 
How to setup a development environment for ONAP
How to setup a development environment for ONAPHow to setup a development environment for ONAP
How to setup a development environment for ONAP
 
Javantura v4 - FreeMarker in Spring web - Marin Kalapać
Javantura v4 - FreeMarker in Spring web - Marin KalapaćJavantura v4 - FreeMarker in Spring web - Marin Kalapać
Javantura v4 - FreeMarker in Spring web - Marin Kalapać
 
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
Microservices Platform with Spring Boot, Spring Cloud Config, Spring Cloud Ne...
 
UWP apps development - Part 2
UWP apps development - Part 2UWP apps development - Part 2
UWP apps development - Part 2
 
Migration from ASP.NET MVC to ASP.NET Core
Migration from ASP.NET MVC to ASP.NET CoreMigration from ASP.NET MVC to ASP.NET Core
Migration from ASP.NET MVC to ASP.NET Core
 
DDD and CQRS for .NET Developers
DDD and CQRS for .NET DevelopersDDD and CQRS for .NET Developers
DDD and CQRS for .NET Developers
 
Introduction to Continuous Integration
Introduction to Continuous IntegrationIntroduction to Continuous Integration
Introduction to Continuous Integration
 
Rethinking the debugger
Rethinking the debuggerRethinking the debugger
Rethinking the debugger
 
Testing Microservices
Testing MicroservicesTesting Microservices
Testing Microservices
 
Test driven
Test drivenTest driven
Test driven
 
Brightcove presentation on Automated Testing
Brightcove presentation on Automated TestingBrightcove presentation on Automated Testing
Brightcove presentation on Automated Testing
 

Viewers also liked

Casin & Asociados 2017
Casin & Asociados 2017Casin & Asociados 2017
Casin & Asociados 2017
Diego Tomasino
 
Who Turned Off the Hope: Brexit and the North
Who Turned Off the Hope: Brexit and the NorthWho Turned Off the Hope: Brexit and the North
Who Turned Off the Hope: Brexit and the North
Citizen Network
 
Grupo estable "Defensa y Protección Integral" - "Sociedad Bolivariana".
Grupo estable "Defensa y Protección Integral" - "Sociedad Bolivariana".Grupo estable "Defensa y Protección Integral" - "Sociedad Bolivariana".
Grupo estable "Defensa y Protección Integral" - "Sociedad Bolivariana".
UPEL-IMPM; MPPE (UE. BRICEÑO MÉNDEZ)
 
التقنية في حياتنا
التقنية في حياتناالتقنية في حياتنا
التقنية في حياتنا
Noora Abdullah
 
Decorex Durban 2017 in pictures
Decorex Durban 2017 in picturesDecorex Durban 2017 in pictures
Decorex Durban 2017 in pictures
Fred Felton
 
Propuestas de resolución 2017
Propuestas de resolución 2017Propuestas de resolución 2017
Propuestas de resolución 2017
Nueva Canarias-BC
 
Brand Storytelling - Miért használj a tartalomterjesztéshez fizetett hirdetés...
Brand Storytelling - Miért használj a tartalomterjesztéshez fizetett hirdetés...Brand Storytelling - Miért használj a tartalomterjesztéshez fizetett hirdetés...
Brand Storytelling - Miért használj a tartalomterjesztéshez fizetett hirdetés...
Péter Tóth-Czere
 
Perché le aziende devono essere presenti su internet
Perché le aziende devono essere presenti su internetPerché le aziende devono essere presenti su internet
Perché le aziende devono essere presenti su internet
Clientecontento
 
New Declassified Report Exposes Hamas Human Shield Policy
New Declassified Report Exposes Hamas Human Shield PolicyNew Declassified Report Exposes Hamas Human Shield Policy
New Declassified Report Exposes Hamas Human Shield Policy
IsraelDefenseForces
 
Sportcongres noord nederland Jaap van Zessen
Sportcongres noord nederland Jaap van ZessenSportcongres noord nederland Jaap van Zessen
Sportcongres noord nederland Jaap van Zessen
Jaap van Zessen
 
Presentación
PresentaciónPresentación
Presentación
Jose Mateos
 
Style Framework - SXSW2015
Style Framework - SXSW2015Style Framework - SXSW2015
Style Framework - SXSW2015
Marti Gold
 
Webinar - Introducción a la ISO/IEC 29110-4-1:2011
Webinar - Introducción a la ISO/IEC 29110-4-1:2011Webinar - Introducción a la ISO/IEC 29110-4-1:2011
Webinar - Introducción a la ISO/IEC 29110-4-1:2011
jpalma200680
 
Money Laundering Law Germany
Money Laundering Law GermanyMoney Laundering Law Germany
Money Laundering Law Germany
Lutz Hartmann
 
Don't Believe Trump's Hype: Regulations do Work for Business
Don't Believe Trump's Hype: Regulations do Work for BusinessDon't Believe Trump's Hype: Regulations do Work for Business
Don't Believe Trump's Hype: Regulations do Work for Business
American Sustainable Business Council
 
Muallim ul quran revised
Muallim ul quran revisedMuallim ul quran revised
Muallim ul quran revisedSikander Ghunio
 
Regalos del Chavez a otros Paises
Regalos del Chavez a otros PaisesRegalos del Chavez a otros Paises
Regalos del Chavez a otros Paises
Paraulata Ilustrada
 
Foro activación del empleo 2017. 29 30 MARZO IFEMA
Foro activación del empleo 2017. 29 30 MARZO IFEMAForo activación del empleo 2017. 29 30 MARZO IFEMA
Foro activación del empleo 2017. 29 30 MARZO IFEMA
YOLANDA ROSCO GARCINUÑO
 
AngularJS - podstawy
AngularJS - podstawyAngularJS - podstawy
AngularJS - podstawy
Apptension
 
Dev Ops without the Ops
Dev Ops without the OpsDev Ops without the Ops
Dev Ops without the Ops
Konstantin Gredeskoul
 

Viewers also liked (20)

Casin & Asociados 2017
Casin & Asociados 2017Casin & Asociados 2017
Casin & Asociados 2017
 
Who Turned Off the Hope: Brexit and the North
Who Turned Off the Hope: Brexit and the NorthWho Turned Off the Hope: Brexit and the North
Who Turned Off the Hope: Brexit and the North
 
Grupo estable "Defensa y Protección Integral" - "Sociedad Bolivariana".
Grupo estable "Defensa y Protección Integral" - "Sociedad Bolivariana".Grupo estable "Defensa y Protección Integral" - "Sociedad Bolivariana".
Grupo estable "Defensa y Protección Integral" - "Sociedad Bolivariana".
 
التقنية في حياتنا
التقنية في حياتناالتقنية في حياتنا
التقنية في حياتنا
 
Decorex Durban 2017 in pictures
Decorex Durban 2017 in picturesDecorex Durban 2017 in pictures
Decorex Durban 2017 in pictures
 
Propuestas de resolución 2017
Propuestas de resolución 2017Propuestas de resolución 2017
Propuestas de resolución 2017
 
Brand Storytelling - Miért használj a tartalomterjesztéshez fizetett hirdetés...
Brand Storytelling - Miért használj a tartalomterjesztéshez fizetett hirdetés...Brand Storytelling - Miért használj a tartalomterjesztéshez fizetett hirdetés...
Brand Storytelling - Miért használj a tartalomterjesztéshez fizetett hirdetés...
 
Perché le aziende devono essere presenti su internet
Perché le aziende devono essere presenti su internetPerché le aziende devono essere presenti su internet
Perché le aziende devono essere presenti su internet
 
New Declassified Report Exposes Hamas Human Shield Policy
New Declassified Report Exposes Hamas Human Shield PolicyNew Declassified Report Exposes Hamas Human Shield Policy
New Declassified Report Exposes Hamas Human Shield Policy
 
Sportcongres noord nederland Jaap van Zessen
Sportcongres noord nederland Jaap van ZessenSportcongres noord nederland Jaap van Zessen
Sportcongres noord nederland Jaap van Zessen
 
Presentación
PresentaciónPresentación
Presentación
 
Style Framework - SXSW2015
Style Framework - SXSW2015Style Framework - SXSW2015
Style Framework - SXSW2015
 
Webinar - Introducción a la ISO/IEC 29110-4-1:2011
Webinar - Introducción a la ISO/IEC 29110-4-1:2011Webinar - Introducción a la ISO/IEC 29110-4-1:2011
Webinar - Introducción a la ISO/IEC 29110-4-1:2011
 
Money Laundering Law Germany
Money Laundering Law GermanyMoney Laundering Law Germany
Money Laundering Law Germany
 
Don't Believe Trump's Hype: Regulations do Work for Business
Don't Believe Trump's Hype: Regulations do Work for BusinessDon't Believe Trump's Hype: Regulations do Work for Business
Don't Believe Trump's Hype: Regulations do Work for Business
 
Muallim ul quran revised
Muallim ul quran revisedMuallim ul quran revised
Muallim ul quran revised
 
Regalos del Chavez a otros Paises
Regalos del Chavez a otros PaisesRegalos del Chavez a otros Paises
Regalos del Chavez a otros Paises
 
Foro activación del empleo 2017. 29 30 MARZO IFEMA
Foro activación del empleo 2017. 29 30 MARZO IFEMAForo activación del empleo 2017. 29 30 MARZO IFEMA
Foro activación del empleo 2017. 29 30 MARZO IFEMA
 
AngularJS - podstawy
AngularJS - podstawyAngularJS - podstawy
AngularJS - podstawy
 
Dev Ops without the Ops
Dev Ops without the OpsDev Ops without the Ops
Dev Ops without the Ops
 

Similar to ASP.NET Core Demos Part 2

Алексей Веркеенко "Symfony2 & REST API"
Алексей Веркеенко "Symfony2 & REST API" Алексей Веркеенко "Symfony2 & REST API"
Алексей Веркеенко "Symfony2 & REST API"
Fwdays
 
Laravel session 1
Laravel  session 1Laravel  session 1
Laravel session 1
Ashish Kumar
 
WebDev Crash Course
WebDev Crash CourseWebDev Crash Course
WebDev Crash Course
Cesar Martinez
 
Asp 1-mvc introduction
Asp 1-mvc introductionAsp 1-mvc introduction
Asp 1-mvc introduction
Fajar Baskoro
 
Fast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVCFast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVC
Ankit Kashyap
 
Software Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableSoftware Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuable
Comsysto Reply GmbH
 
Agile Secure Cloud Application Development Management
Agile Secure Cloud Application Development ManagementAgile Secure Cloud Application Development Management
Agile Secure Cloud Application Development Management
Adam Getchell
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
Thomas Robbins
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8
Thomas Robbins
 
E-Commerce Applications Development
E-Commerce Applications Development E-Commerce Applications Development
E-Commerce Applications Development
Muhammad Sajid
 
MVC + ORM (with project implementation)
MVC + ORM (with project implementation)MVC + ORM (with project implementation)
MVC + ORM (with project implementation)
Prateek Chauhan
 
Introduction to ASP.Net MVC
Introduction to ASP.Net MVCIntroduction to ASP.Net MVC
Introduction to ASP.Net MVCSagar Kamate
 
IaC? VSTS to the rescue! Abbreviations explained
IaC? VSTS to the rescue! Abbreviations explainedIaC? VSTS to the rescue! Abbreviations explained
IaC? VSTS to the rescue! Abbreviations explained
Jeroen Niesen
 
Mini-Training: NancyFX
Mini-Training: NancyFXMini-Training: NancyFX
Mini-Training: NancyFX
Betclic Everest Group Tech Team
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online Training
Learntek1
 
React-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsxReact-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsx
Kulbir4
 
Unboxing ASP.NET Core
Unboxing ASP.NET CoreUnboxing ASP.NET Core
Unboxing ASP.NET Core
Kevin Leung
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - Talk
Matthias Noback
 
Clean architecture
Clean architectureClean architecture
Clean architecture
Travis Frisinger
 

Similar to ASP.NET Core Demos Part 2 (20)

Алексей Веркеенко "Symfony2 & REST API"
Алексей Веркеенко "Symfony2 & REST API" Алексей Веркеенко "Symfony2 & REST API"
Алексей Веркеенко "Symfony2 & REST API"
 
Laravel session 1
Laravel  session 1Laravel  session 1
Laravel session 1
 
WebDev Crash Course
WebDev Crash CourseWebDev Crash Course
WebDev Crash Course
 
Asp 1-mvc introduction
Asp 1-mvc introductionAsp 1-mvc introduction
Asp 1-mvc introduction
 
Fast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVCFast Track introduction to ASP.NET MVC
Fast Track introduction to ASP.NET MVC
 
Software Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableSoftware Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuable
 
Agile Secure Cloud Application Development Management
Agile Secure Cloud Application Development ManagementAgile Secure Cloud Application Development Management
Agile Secure Cloud Application Development Management
 
Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013Getting started with MVC 5 and Visual Studio 2013
Getting started with MVC 5 and Visual Studio 2013
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8
 
Mvc
MvcMvc
Mvc
 
E-Commerce Applications Development
E-Commerce Applications Development E-Commerce Applications Development
E-Commerce Applications Development
 
MVC + ORM (with project implementation)
MVC + ORM (with project implementation)MVC + ORM (with project implementation)
MVC + ORM (with project implementation)
 
Introduction to ASP.Net MVC
Introduction to ASP.Net MVCIntroduction to ASP.Net MVC
Introduction to ASP.Net MVC
 
IaC? VSTS to the rescue! Abbreviations explained
IaC? VSTS to the rescue! Abbreviations explainedIaC? VSTS to the rescue! Abbreviations explained
IaC? VSTS to the rescue! Abbreviations explained
 
Mini-Training: NancyFX
Mini-Training: NancyFXMini-Training: NancyFX
Mini-Training: NancyFX
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online Training
 
React-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsxReact-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsx
 
Unboxing ASP.NET Core
Unboxing ASP.NET CoreUnboxing ASP.NET Core
Unboxing ASP.NET Core
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - Talk
 
Clean architecture
Clean architectureClean architecture
Clean architecture
 

Recently uploaded

How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Jay Das
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 

Recently uploaded (20)

How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfEnhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdf
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 

ASP.NET Core Demos Part 2

  • 2. ERIK NOREN Solutions Architect Software Developer 15+ Years Software Tinkerer Since Commodore 64 Hardware Hobbyist Twitter: @ErikNoren GitHub: ErikNoren
  • 3. ASP.NET CORE QUICK START Middleware
  • 4. MIDDLEWARE • Serve as the “pipeline” for handling requests • Order of middleware is significant and should be carefully considered • Requests pass through middleware in the order defined and responses in reverse order • A single request cycle uses the same middleware class instance • Data and information stored in member variables during request available during response • Each middleware component is responsible for passing on or short circuiting
  • 5. MIDDLEWARE When a request comes in, instances of the middleware components are created as needed. Logic prior to awaiting on the RequestDelegate is thought of as reading the incoming request. Logic after that point is thought of as processing the response. This is convention; really you have access to both on either side of the delegate. A HttpContext object is passed from one component to the next giving each a chance to read, alter, or handle a request. Middleware that can fully handle a request does not have to invoke the RequestDelegate. That component becomes the last in the
  • 6. MIDDLEWARE • Dependency injection works as expected • Configuring middleware should follow Options Pattern • Define a “configuring action” to set parameters • Ensures any pre-configuration is not lost by user creating new options object • Unambiguous on lifetime of options object • Cleaner, more fluent style code • Exception: 0 to 2 options is easier to pass as parameters; no extra options class and action • Not a hard rule, just a style guideline
  • 7. ASP.NET CORE QUICK START Middleware Demo
  • 8. ASP.NET CORE QUICK START Controllers
  • 9. CONTROLLERS • No separate controllers for View vs API actions • Don’t have to use base class at all but provides convenient methods • A single controller can serve data to API requests and HTML to browsers • *Even though it can, that doesn’t mean it should • Route configuration still available but attribute routing is becoming more common
  • 10. CONTROLLERS • Web API HttpRequestMessage and HttpResponseMessage are gone (Yay!) • There is a shim available for people porting WebAPI code that used these • Preference is either concrete type or IActionResult • ASP.NET MVC Controllers are largely unchanged except new pipeline for requests • Returning a View performs the same search for pages as before • Razor Views have new Tag Helpers (But that’s UI and outside the scope of this talk!) • HTML tag and attribute based – similar to AngularJS
  • 11. ASP.NET CORE QUICK START Controllers Demo
  • 12. ASP.NET CORE QUICK START Entity Framework Core
  • 13. • Everything you’ve heard is true (probably) • Complete rewrite • New architecture • Regression of capabilities • Despite regressed functionality, the design is much more flexible with more capability • Providers allow LINQ to be translated for different data stores • Relational database base classes and SQL Server already in place; non-relational coming soon • Developers aren’t concerned with how data gets persisted and restored when ENTITY FRAMEWORK CORE
  • 14. • In Memory Provider • So great it deserved its own slide • Developers doing code first can work independent of data stores • Iterate on features without making database changes that affect others • Faster cycle to make changes and see affect without modifying and restoring database schema • “Unit testing” becomes easier • Most people are actually writing integration tests • Database state is deterministic • No need to reset database or worry about modifying others’ data • It becomes necessary to seed data in order to test code but bad data is no longer ENTITY FRAMEWORK CORE
  • 15. ASP.NET CORE QUICK START Entity Framework Core Demo
  • 16. BONUS: VISUAL STUDIO 2017 TIPS Project Dependencies & Packages
  • 17. • Adding a project reference to a project that creates a NuGet package: • Making changes in the referenced project are reflected on recompile • No need to generate the package, publish to repository, update NuGet in dependent project • When building dependent solution as package, referenced project DLLs are not included • Referenced project NuGet package is added as a dependency of dependent solution’s package • This tooling change makes it much easier to create Abstraction / Contract packages VISUAL STUDIO 2017: PROJECT PACKAGES
  • 18. BONUS: VISUAL STUDIO 2017 TIPS Project Dependencies & Packages Demo
  • 19. QUESTIONS? Erik Noren Solutions Architect Software Developer 15+ Years Software Tinkerer Since Commodore 64 Hardware Hobbyist Twitter: @ErikNoren GitHub: ErikNoren
  • 20. RESOURCES • Demo Code Samples - https://github.com/ErikNoren/AspNetCoreDemos • ASP.NET Core – https://www.asp.net/core • ASP.NET Core Source – https://github.com/aspnet/home • Microsoft Docs – https://docs.microsoft.com/ • Julie Lerman, Fantastic Data & Entity Framework Resource – http://thedatafarm.com/blog/ • Julie on Pluralsight – https://www.pluralsight.com/search?q=julie+lerman&categories=aem-author