SlideShare une entreprise Scribd logo
1  sur  23
Alex Thissen
Lead Consultant Xpirit
ASP.NET MVC 6
A new unified programming model for the web
Agenda
• Short overview ASP.NET 5
• A unified programming model
• Controllers
• Dependency Injection
• Routing
• Summary
• Questions and Answers
An overview
Viewing from 10.000 feet
ASP.NET components
MVC 6
Unified Web Stack
Characteristics of MVC 6
•One set of concepts – remove duplication
•Web UI and APIs combined
•Smooth transition from Web Pages to MVC
Unified
•Run on IIS or self-host or cross-platform
•Based on new request pipeline in ASP.NET 5
•Runs in cloud-optimized Core CLR
Built on top
of ASP.NET 5
•Pay as you use
•Middleware
•Built with Dependency Injection first
Modular
Getting familiar
.NET Framework vNext
Full .NET CLR
• Entire API set in machine
wide install at 200 MB
• Updated with OS
• Ecosystem of existing
packages
• Backward compatibility
• Default for
Visual Studio 2015 projects
Cloud Optimized CLR
• Lean and modular runtime
• Optimized for server
• Small memory footprint
• Libraries in NuGet packages
• Framework deployed with
app
• Different versions can run
side-by-side
• 11 MB
Mono
• Cross-Platform runtime for
Linux and Mac OS X
• Together with Mono
community
Standing on the shoulders of a new giant
ASP.NET 5.0 ASP.NET 5.0 ASP.NET 5.0
Getting started
• Middleware model introduced by OWIN
Ready, set, start – a lap around MVC 6
Middleware conceptually
• Middleware stack
• Static files
• Security, authentication,
CORS
• Diagnostics, logging
• Other cross-cutting concerns
Host process and server
Application and framework
RequestDelegate
delegate Task
RequestDelegate(HttpContext
context);
public void Configure(IApplicationBuilder app)
{
app.Map("/Nancy",
builder =>
{ builder.UseRuntimeInfo();
builder.RunNancyFx();
});
app.UseCors();
app.UseMvc(cfg);
Use, Map and Run
app.UseErrorPage();
Application FX
Middleware
Controllers
• Single base class for
MVC and Web API
• Not required
• POCO Controllers
• No base class
• Combine Web API and
MVC in 1 class
• UI and REST endpoints
at one base URI
Not your typical gaming gear
Dependency Injection
It all depends
Dependency Injection
• DI is core part of runtime
• Built-in DI for configuration and services
– Default lightweight version available
• Wire up your own favorite IoC container ...
– Autofac, Ninject, StructureMap, Unity, Castle Windsor
public void ConfigureServices(IServiceCollection services)
{
// Add EF services to the services container.
services.AddEntityFramework(Configuration)
.AddSqlServer()
.AddDbContext<ApplicationDbContext>();
Built-in DI Container
• Register mappings in ConfigureServices of Startup
• Default registrations
• Lifetimes
– Transient
– Scoped
– Singleton
– Instance
• Rules for registering mapping
– First one wins
– Allows you to get ahead off default mappings
Sometimes better is worse than good enough
Activation
Activation method Example
Constructor on classes MyController(ILog logger)
Attribute on field or
property
[Activate]
ILog Logger { get;set; }
Attribute in action [FromServices] ILog logger
Directive in Razor page ILog logger
Inject those objects
@inject
Tag Helpers
• Allow server-side code to participate in rendering of
HTML elements in Razor files
• Target HTML elements based on element and attribute
names
• Reduce explicit transitions between HTML and C#
• Take advantage of composition and tooling benefits in
Visual Studio Code and 2015
Getting some help in Razor
Custom Tag Helpers
namespace TechDays.TagHelpers
{
[TargetElement("datumtijd")]
public class DateTimeTagHelper : TagHelper
{
public override void Process(TagHelperContext context,
TagHelperOutput output) {
output.Content.SetContent(DateTime.Now.ToString());
}
}
}
// Inside Razor .cshtml file
@addTagHelper "*, TechDays.TagHelpers"
Routing
• Familiar MVC 5 attribute based routing
• Enabled by default
• Special tokens: [controller] and [action]
Show me the way
[Route("api/Hello")]
public class HelloController : Controller
{
[Route]
public string Get()
{
return "hello";
}
}
[Route("api/[controller]")]
public class HelloController : Controller
{
[Route]
public string Get()
{
return "hello";
}
}
View components
• Comparable to Web Forms’ UserControls
• Different from Partial Views
• Combines code and view as logical unit
User controls in MVC style
Logging
• Pluggable logging infrastructure provided
• ILoggerFactory
• Logging levels
– from Debug up to Criticial
Summary
• Unified programming model
• Built on ASP.NET 5
• Learn Dependency Injection
• Command-line vs. Visual Studio
Key takeaways from ASP.NET MVC 6
Your feedback is important!
Scan the QR Code and let us know via the TechDays App.
Laat ons weten wat u van de sessie vindt!
Scan the QR Code via de TechDays App.
Bent u al lid van de Microsot Virtual Academy?! Op MVA kunt u altijd iets
nieuws leren over de laatste technologie van Microsoft. Meld u vandaag aan
op de MVA Stand. MVA biedt 7/24 gratis online training on-demand voor IT-
Professionals en Ontwikkelaars.
ASP.NET MVC 6: A New Unified Programming Model for the Web

Contenu connexe

Tendances

Tokyo azure meetup #12 service fabric internals
Tokyo azure meetup #12   service fabric internalsTokyo azure meetup #12   service fabric internals
Tokyo azure meetup #12 service fabric internalsTokyo Azure Meetup
 
Grails in the Cloud (2013)
Grails in the Cloud (2013)Grails in the Cloud (2013)
Grails in the Cloud (2013)Meni Lubetkin
 
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)Red Hat Developers
 
Data stores: beyond relational databases
Data stores: beyond relational databasesData stores: beyond relational databases
Data stores: beyond relational databasesJavier García Magna
 
Node and Micro-Services at IBM
Node and Micro-Services at IBMNode and Micro-Services at IBM
Node and Micro-Services at IBMDejan Glozic
 
Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless worldMatthias Luebken
 
How Apache Kafka® Works
How Apache Kafka® WorksHow Apache Kafka® Works
How Apache Kafka® Worksconfluent
 
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Red Hat Developers
 
How Class Data Sharing Can Speed up Your Jakarta EE Application Startup
How Class Data Sharing Can Speed up Your Jakarta EE Application StartupHow Class Data Sharing Can Speed up Your Jakarta EE Application Startup
How Class Data Sharing Can Speed up Your Jakarta EE Application StartupRudy De Busscher
 
WSO2Con USA 2017: Scalable Real-time Complex Event Processing at Uber
WSO2Con USA 2017: Scalable Real-time Complex Event Processing at UberWSO2Con USA 2017: Scalable Real-time Complex Event Processing at Uber
WSO2Con USA 2017: Scalable Real-time Complex Event Processing at UberWSO2
 
Gradual migration to MicroProfile
Gradual migration to MicroProfileGradual migration to MicroProfile
Gradual migration to MicroProfileRudy De Busscher
 
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?João Pedro Martins
 
Cloudsolutionday 2016: Docker & FAAS at getvero.com
Cloudsolutionday 2016: Docker & FAAS at getvero.comCloudsolutionday 2016: Docker & FAAS at getvero.com
Cloudsolutionday 2016: Docker & FAAS at getvero.comAWS Vietnam Community
 
.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric.NET microservices with Azure Service Fabric
.NET microservices with Azure Service FabricDavide Benvegnù
 
JavaEE Microservices platforms
JavaEE Microservices platformsJavaEE Microservices platforms
JavaEE Microservices platformsPayara
 
Kubernetes as Orchestrator for A10 Lightning Controller
Kubernetes as Orchestrator for A10 Lightning ControllerKubernetes as Orchestrator for A10 Lightning Controller
Kubernetes as Orchestrator for A10 Lightning ControllerAkshay Mathur
 
Automation 2.0 - Automation Tools for Hybrid Cloud Environments
Automation 2.0 - Automation Tools for Hybrid Cloud EnvironmentsAutomation 2.0 - Automation Tools for Hybrid Cloud Environments
Automation 2.0 - Automation Tools for Hybrid Cloud EnvironmentsMichael Rüefli
 
Secure JAX-RS
Secure JAX-RSSecure JAX-RS
Secure JAX-RSPayara
 
Techniques for scaling application with security and visibility in cloud
Techniques for scaling application with security and visibility in cloudTechniques for scaling application with security and visibility in cloud
Techniques for scaling application with security and visibility in cloudAkshay Mathur
 

Tendances (20)

Tokyo azure meetup #12 service fabric internals
Tokyo azure meetup #12   service fabric internalsTokyo azure meetup #12   service fabric internals
Tokyo azure meetup #12 service fabric internals
 
Grails in the Cloud (2013)
Grails in the Cloud (2013)Grails in the Cloud (2013)
Grails in the Cloud (2013)
 
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
 
Data stores: beyond relational databases
Data stores: beyond relational databasesData stores: beyond relational databases
Data stores: beyond relational databases
 
Node and Micro-Services at IBM
Node and Micro-Services at IBMNode and Micro-Services at IBM
Node and Micro-Services at IBM
 
Who needs containers in a serverless world
Who needs containers in a serverless worldWho needs containers in a serverless world
Who needs containers in a serverless world
 
How Apache Kafka® Works
How Apache Kafka® WorksHow Apache Kafka® Works
How Apache Kafka® Works
 
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
 
How Class Data Sharing Can Speed up Your Jakarta EE Application Startup
How Class Data Sharing Can Speed up Your Jakarta EE Application StartupHow Class Data Sharing Can Speed up Your Jakarta EE Application Startup
How Class Data Sharing Can Speed up Your Jakarta EE Application Startup
 
WSO2Con USA 2017: Scalable Real-time Complex Event Processing at Uber
WSO2Con USA 2017: Scalable Real-time Complex Event Processing at UberWSO2Con USA 2017: Scalable Real-time Complex Event Processing at Uber
WSO2Con USA 2017: Scalable Real-time Complex Event Processing at Uber
 
Gradual migration to MicroProfile
Gradual migration to MicroProfileGradual migration to MicroProfile
Gradual migration to MicroProfile
 
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
 
Cloudsolutionday 2016: Docker & FAAS at getvero.com
Cloudsolutionday 2016: Docker & FAAS at getvero.comCloudsolutionday 2016: Docker & FAAS at getvero.com
Cloudsolutionday 2016: Docker & FAAS at getvero.com
 
.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric
 
JavaEE Microservices platforms
JavaEE Microservices platformsJavaEE Microservices platforms
JavaEE Microservices platforms
 
Kubernetes as Orchestrator for A10 Lightning Controller
Kubernetes as Orchestrator for A10 Lightning ControllerKubernetes as Orchestrator for A10 Lightning Controller
Kubernetes as Orchestrator for A10 Lightning Controller
 
Automation 2.0 - Automation Tools for Hybrid Cloud Environments
Automation 2.0 - Automation Tools for Hybrid Cloud EnvironmentsAutomation 2.0 - Automation Tools for Hybrid Cloud Environments
Automation 2.0 - Automation Tools for Hybrid Cloud Environments
 
Secure JAX-RS
Secure JAX-RSSecure JAX-RS
Secure JAX-RS
 
Techniques for scaling application with security and visibility in cloud
Techniques for scaling application with security and visibility in cloudTechniques for scaling application with security and visibility in cloud
Techniques for scaling application with security and visibility in cloud
 
104 meets cloud
104 meets cloud104 meets cloud
104 meets cloud
 

En vedette

En vedette (13)

MZ_Educational_Dev
MZ_Educational_DevMZ_Educational_Dev
MZ_Educational_Dev
 
Caracteristicas y mediaciones de la educacion a distancia
Caracteristicas y mediaciones de la educacion  a distanciaCaracteristicas y mediaciones de la educacion  a distancia
Caracteristicas y mediaciones de la educacion a distancia
 
Comment intégrer les switch Nebula à votre réseau
Comment intégrer les switch Nebula à votre réseauComment intégrer les switch Nebula à votre réseau
Comment intégrer les switch Nebula à votre réseau
 
Highlight Portfolio_Xinyi Huang(April2016) (dragged)
Highlight Portfolio_Xinyi Huang(April2016) (dragged)Highlight Portfolio_Xinyi Huang(April2016) (dragged)
Highlight Portfolio_Xinyi Huang(April2016) (dragged)
 
Animales acuaticos
Animales acuaticosAnimales acuaticos
Animales acuaticos
 
Italy PowerPoint
Italy PowerPointItaly PowerPoint
Italy PowerPoint
 
Redes sociales
Redes socialesRedes sociales
Redes sociales
 
Padilla sosa lizeth_margarita_tarea3
Padilla sosa lizeth_margarita_tarea3Padilla sosa lizeth_margarita_tarea3
Padilla sosa lizeth_margarita_tarea3
 
хакимкаиргельды+компания+клиенты
хакимкаиргельды+компания+клиентыхакимкаиргельды+компания+клиенты
хакимкаиргельды+компания+клиенты
 
Near_Neighbours_Coventry_University_Evaluation (1)
Near_Neighbours_Coventry_University_Evaluation (1)Near_Neighbours_Coventry_University_Evaluation (1)
Near_Neighbours_Coventry_University_Evaluation (1)
 
серкеноваулжан+ремонтквартир+клиенты
серкеноваулжан+ремонтквартир+клиентысеркеноваулжан+ремонтквартир+клиенты
серкеноваулжан+ремонтквартир+клиенты
 
Marketing
MarketingMarketing
Marketing
 
Andre rieu
Andre rieuAndre rieu
Andre rieu
 

Similaire à ASP.NET MVC 6: A New Unified Programming Model for the Web

SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4Jon Galloway
 
ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0Ido Flatow
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8Thomas Robbins
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5mbaric
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVCSirwan Afifi
 
ASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesEamonn Boyle
 
Introduction to ASP.Net MVC
Introduction to ASP.Net MVCIntroduction to ASP.Net MVC
Introduction to ASP.Net MVCSagar Kamate
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesVagif Abilov
 
ASP.NET 5 Overview - Post Build 2015
ASP.NET 5 Overview - Post Build 2015ASP.NET 5 Overview - Post Build 2015
ASP.NET 5 Overview - Post Build 2015Shahed Chowdhuri
 
.NET Core: a new .NET Platform
.NET Core: a new .NET Platform.NET Core: a new .NET Platform
.NET Core: a new .NET PlatformAlex Thissen
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpChalermpon Areepong
 
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...Tokyo Azure Meetup
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC vipin kumar
 
What's New in .Net 4.5
What's New in .Net 4.5What's New in .Net 4.5
What's New in .Net 4.5Malam Team
 
ASP.NET 5 Overview: Post RTM
ASP.NET 5 Overview: Post RTMASP.NET 5 Overview: Post RTM
ASP.NET 5 Overview: Post RTMShahed Chowdhuri
 
ASP.NET 5 Overview for Apex Systems
ASP.NET 5 Overview for Apex SystemsASP.NET 5 Overview for Apex Systems
ASP.NET 5 Overview for Apex SystemsShahed Chowdhuri
 
.NET Core Apps: Design & Development
.NET Core Apps: Design & Development.NET Core Apps: Design & Development
.NET Core Apps: Design & DevelopmentGlobalLogic Ukraine
 

Similaire à ASP.NET MVC 6: A New Unified Programming Model for the Web (20)

SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4
 
ASP.NET Core 1.0
ASP.NET Core 1.0ASP.NET Core 1.0
ASP.NET Core 1.0
 
Using MVC with Kentico 8
Using MVC with Kentico 8Using MVC with Kentico 8
Using MVC with Kentico 8
 
Introduction to ASP.NET 5
Introduction to ASP.NET 5Introduction to ASP.NET 5
Introduction to ASP.NET 5
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
ASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesASP .Net Core SPA Templates
ASP .Net Core SPA Templates
 
Introduction to ASP.Net MVC
Introduction to ASP.Net MVCIntroduction to ASP.Net MVC
Introduction to ASP.Net MVC
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class Libraries
 
ASP.NET 5 Overview - Post Build 2015
ASP.NET 5 Overview - Post Build 2015ASP.NET 5 Overview - Post Build 2015
ASP.NET 5 Overview - Post Build 2015
 
.NET Core: a new .NET Platform
.NET Core: a new .NET Platform.NET Core: a new .NET Platform
.NET Core: a new .NET Platform
 
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvpZZ BC#7 asp.net mvc practice and guideline by NineMvp
ZZ BC#7 asp.net mvc practice and guideline by NineMvp
 
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC
 
What's New in .Net 4.5
What's New in .Net 4.5What's New in .Net 4.5
What's New in .Net 4.5
 
ASP.NET
ASP.NETASP.NET
ASP.NET
 
ASP.NET 5 Overview: Post RTM
ASP.NET 5 Overview: Post RTMASP.NET 5 Overview: Post RTM
ASP.NET 5 Overview: Post RTM
 
ASP.NET 5 Overview for Apex Systems
ASP.NET 5 Overview for Apex SystemsASP.NET 5 Overview for Apex Systems
ASP.NET 5 Overview for Apex Systems
 
Mvc4
Mvc4Mvc4
Mvc4
 
.NET Core Apps: Design & Development
.NET Core Apps: Design & Development.NET Core Apps: Design & Development
.NET Core Apps: Design & Development
 
Mvc
MvcMvc
Mvc
 

Plus de Alex Thissen

Go (con)figure - Making sense of .NET configuration
Go (con)figure - Making sense of .NET configurationGo (con)figure - Making sense of .NET configuration
Go (con)figure - Making sense of .NET configurationAlex Thissen
 
Logging, tracing and metrics: Instrumentation in .NET 5 and Azure
Logging, tracing and metrics: Instrumentation in .NET 5 and AzureLogging, tracing and metrics: Instrumentation in .NET 5 and Azure
Logging, tracing and metrics: Instrumentation in .NET 5 and AzureAlex Thissen
 
Logging tracing and metrics in .NET Core and Azure - dotnetdays 2020
Logging tracing and metrics in .NET Core and Azure - dotnetdays 2020Logging tracing and metrics in .NET Core and Azure - dotnetdays 2020
Logging tracing and metrics in .NET Core and Azure - dotnetdays 2020Alex Thissen
 
Health monitoring and dependency injection - CNUG November 2019
Health monitoring and dependency injection - CNUG November 2019Health monitoring and dependency injection - CNUG November 2019
Health monitoring and dependency injection - CNUG November 2019Alex Thissen
 
Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019
Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019
Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019Alex Thissen
 
I dont feel so well. Integrating health checks in your .NET Core solutions - ...
I dont feel so well. Integrating health checks in your .NET Core solutions - ...I dont feel so well. Integrating health checks in your .NET Core solutions - ...
I dont feel so well. Integrating health checks in your .NET Core solutions - ...Alex Thissen
 
It depends: Loving .NET Core dependency injection or not
It depends: Loving .NET Core dependency injection or notIt depends: Loving .NET Core dependency injection or not
It depends: Loving .NET Core dependency injection or notAlex Thissen
 
Overview of the new .NET Core and .NET Platform Standard
Overview of the new .NET Core and .NET Platform StandardOverview of the new .NET Core and .NET Platform Standard
Overview of the new .NET Core and .NET Platform StandardAlex Thissen
 
How Docker and ASP.NET Core will change the life of a Microsoft developer
How Docker and ASP.NET Core will change the life of a Microsoft developerHow Docker and ASP.NET Core will change the life of a Microsoft developer
How Docker and ASP.NET Core will change the life of a Microsoft developerAlex Thissen
 
Visual Studio Productivity tips
Visual Studio Productivity tipsVisual Studio Productivity tips
Visual Studio Productivity tipsAlex Thissen
 
Exploring microservices in a Microsoft landscape
Exploring microservices in a Microsoft landscapeExploring microservices in a Microsoft landscape
Exploring microservices in a Microsoft landscapeAlex Thissen
 
Asynchronous programming in ASP.NET
Asynchronous programming in ASP.NETAsynchronous programming in ASP.NET
Asynchronous programming in ASP.NETAlex Thissen
 
Visual Studio 2015 experts tips and tricks
Visual Studio 2015 experts tips and tricksVisual Studio 2015 experts tips and tricks
Visual Studio 2015 experts tips and tricksAlex Thissen
 
ASP.NET 5 - Microsoft's Web development platform reimagined
ASP.NET 5 - Microsoft's Web development platform reimaginedASP.NET 5 - Microsoft's Web development platform reimagined
ASP.NET 5 - Microsoft's Web development platform reimaginedAlex Thissen
 

Plus de Alex Thissen (15)

Go (con)figure - Making sense of .NET configuration
Go (con)figure - Making sense of .NET configurationGo (con)figure - Making sense of .NET configuration
Go (con)figure - Making sense of .NET configuration
 
Logging, tracing and metrics: Instrumentation in .NET 5 and Azure
Logging, tracing and metrics: Instrumentation in .NET 5 and AzureLogging, tracing and metrics: Instrumentation in .NET 5 and Azure
Logging, tracing and metrics: Instrumentation in .NET 5 and Azure
 
Logging tracing and metrics in .NET Core and Azure - dotnetdays 2020
Logging tracing and metrics in .NET Core and Azure - dotnetdays 2020Logging tracing and metrics in .NET Core and Azure - dotnetdays 2020
Logging tracing and metrics in .NET Core and Azure - dotnetdays 2020
 
Health monitoring and dependency injection - CNUG November 2019
Health monitoring and dependency injection - CNUG November 2019Health monitoring and dependency injection - CNUG November 2019
Health monitoring and dependency injection - CNUG November 2019
 
Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019
Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019
Architecting .NET solutions in a Docker ecosystem - .NET Fest Kyiv 2019
 
I dont feel so well. Integrating health checks in your .NET Core solutions - ...
I dont feel so well. Integrating health checks in your .NET Core solutions - ...I dont feel so well. Integrating health checks in your .NET Core solutions - ...
I dont feel so well. Integrating health checks in your .NET Core solutions - ...
 
It depends: Loving .NET Core dependency injection or not
It depends: Loving .NET Core dependency injection or notIt depends: Loving .NET Core dependency injection or not
It depends: Loving .NET Core dependency injection or not
 
Overview of the new .NET Core and .NET Platform Standard
Overview of the new .NET Core and .NET Platform StandardOverview of the new .NET Core and .NET Platform Standard
Overview of the new .NET Core and .NET Platform Standard
 
How Docker and ASP.NET Core will change the life of a Microsoft developer
How Docker and ASP.NET Core will change the life of a Microsoft developerHow Docker and ASP.NET Core will change the life of a Microsoft developer
How Docker and ASP.NET Core will change the life of a Microsoft developer
 
Visual Studio Productivity tips
Visual Studio Productivity tipsVisual Studio Productivity tips
Visual Studio Productivity tips
 
Exploring microservices in a Microsoft landscape
Exploring microservices in a Microsoft landscapeExploring microservices in a Microsoft landscape
Exploring microservices in a Microsoft landscape
 
Asynchronous programming in ASP.NET
Asynchronous programming in ASP.NETAsynchronous programming in ASP.NET
Asynchronous programming in ASP.NET
 
Visual Studio 2015 experts tips and tricks
Visual Studio 2015 experts tips and tricksVisual Studio 2015 experts tips and tricks
Visual Studio 2015 experts tips and tricks
 
ASP.NET 5 - Microsoft's Web development platform reimagined
ASP.NET 5 - Microsoft's Web development platform reimaginedASP.NET 5 - Microsoft's Web development platform reimagined
ASP.NET 5 - Microsoft's Web development platform reimagined
 
//customer/
//customer///customer/
//customer/
 

Dernier

The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 

Dernier (20)

The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 

ASP.NET MVC 6: A New Unified Programming Model for the Web

  • 1.
  • 2. Alex Thissen Lead Consultant Xpirit ASP.NET MVC 6 A new unified programming model for the web
  • 3. Agenda • Short overview ASP.NET 5 • A unified programming model • Controllers • Dependency Injection • Routing • Summary • Questions and Answers
  • 6. Characteristics of MVC 6 •One set of concepts – remove duplication •Web UI and APIs combined •Smooth transition from Web Pages to MVC Unified •Run on IIS or self-host or cross-platform •Based on new request pipeline in ASP.NET 5 •Runs in cloud-optimized Core CLR Built on top of ASP.NET 5 •Pay as you use •Middleware •Built with Dependency Injection first Modular Getting familiar
  • 7. .NET Framework vNext Full .NET CLR • Entire API set in machine wide install at 200 MB • Updated with OS • Ecosystem of existing packages • Backward compatibility • Default for Visual Studio 2015 projects Cloud Optimized CLR • Lean and modular runtime • Optimized for server • Small memory footprint • Libraries in NuGet packages • Framework deployed with app • Different versions can run side-by-side • 11 MB Mono • Cross-Platform runtime for Linux and Mac OS X • Together with Mono community Standing on the shoulders of a new giant ASP.NET 5.0 ASP.NET 5.0 ASP.NET 5.0
  • 8. Getting started • Middleware model introduced by OWIN Ready, set, start – a lap around MVC 6
  • 9. Middleware conceptually • Middleware stack • Static files • Security, authentication, CORS • Diagnostics, logging • Other cross-cutting concerns Host process and server Application and framework RequestDelegate delegate Task RequestDelegate(HttpContext context);
  • 10. public void Configure(IApplicationBuilder app) { app.Map("/Nancy", builder => { builder.UseRuntimeInfo(); builder.RunNancyFx(); }); app.UseCors(); app.UseMvc(cfg); Use, Map and Run app.UseErrorPage(); Application FX Middleware
  • 11. Controllers • Single base class for MVC and Web API • Not required • POCO Controllers • No base class • Combine Web API and MVC in 1 class • UI and REST endpoints at one base URI Not your typical gaming gear
  • 13. Dependency Injection • DI is core part of runtime • Built-in DI for configuration and services – Default lightweight version available • Wire up your own favorite IoC container ... – Autofac, Ninject, StructureMap, Unity, Castle Windsor public void ConfigureServices(IServiceCollection services) { // Add EF services to the services container. services.AddEntityFramework(Configuration) .AddSqlServer() .AddDbContext<ApplicationDbContext>();
  • 14. Built-in DI Container • Register mappings in ConfigureServices of Startup • Default registrations • Lifetimes – Transient – Scoped – Singleton – Instance • Rules for registering mapping – First one wins – Allows you to get ahead off default mappings Sometimes better is worse than good enough
  • 15. Activation Activation method Example Constructor on classes MyController(ILog logger) Attribute on field or property [Activate] ILog Logger { get;set; } Attribute in action [FromServices] ILog logger Directive in Razor page ILog logger Inject those objects @inject
  • 16. Tag Helpers • Allow server-side code to participate in rendering of HTML elements in Razor files • Target HTML elements based on element and attribute names • Reduce explicit transitions between HTML and C# • Take advantage of composition and tooling benefits in Visual Studio Code and 2015 Getting some help in Razor
  • 17. Custom Tag Helpers namespace TechDays.TagHelpers { [TargetElement("datumtijd")] public class DateTimeTagHelper : TagHelper { public override void Process(TagHelperContext context, TagHelperOutput output) { output.Content.SetContent(DateTime.Now.ToString()); } } } // Inside Razor .cshtml file @addTagHelper "*, TechDays.TagHelpers"
  • 18. Routing • Familiar MVC 5 attribute based routing • Enabled by default • Special tokens: [controller] and [action] Show me the way [Route("api/Hello")] public class HelloController : Controller { [Route] public string Get() { return "hello"; } } [Route("api/[controller]")] public class HelloController : Controller { [Route] public string Get() { return "hello"; } }
  • 19. View components • Comparable to Web Forms’ UserControls • Different from Partial Views • Combines code and view as logical unit User controls in MVC style
  • 20. Logging • Pluggable logging infrastructure provided • ILoggerFactory • Logging levels – from Debug up to Criticial
  • 21. Summary • Unified programming model • Built on ASP.NET 5 • Learn Dependency Injection • Command-line vs. Visual Studio Key takeaways from ASP.NET MVC 6
  • 22. Your feedback is important! Scan the QR Code and let us know via the TechDays App. Laat ons weten wat u van de sessie vindt! Scan the QR Code via de TechDays App. Bent u al lid van de Microsot Virtual Academy?! Op MVA kunt u altijd iets nieuws leren over de laatste technologie van Microsoft. Meld u vandaag aan op de MVA Stand. MVA biedt 7/24 gratis online training on-demand voor IT- Professionals en Ontwikkelaars.

Notes de l'éditeur

  1. diego_cervo/istockphoto.com