SlideShare ist ein Scribd-Unternehmen logo
1 von 50
Downloaden Sie, um offline zu lesen
Introduzione ad
Asp Net Core
• Mauro Di Liddo
• .NET Developer
• Mauro.diliddo@hotmail.it
• linkedin.com/in/maurodiliddo/
• https://Speakingcodes.com
Struttura Progetto
• Program.cs
• Startup.cs
• Appsetting.json
• Pages
• wwwroot
_ViewImports
Startup: ConfigureServices
Startup:Configure
I Middleware
I Middleware
• Exception Error handling
• HTTP Strict Transport Security Protocol
• HTTPS redirection
• Static file server
• Cookie policy enforcement
• Authentication
• Session
• MVC
Consentono al codice sul lato server di partecipare
alla creazione e al rendering di elementi HTML nei
file Razor.
TagHelpers: direttiva: @addTagHelper
TagHelpers: direttiva: @removeTagHelper
TagHelpers: direttiva: @tagHelperPrefix
Custom TagHelpers
Custom TagHelpers
Custom TagHelpers
Custom TagHelpers
Reindirizzare una porzione di codice Razor con
una logica di backend associata.
ViewComponent
 Estende la classe "ViewComponent".
 Una "Partial View Razor".
 Implementa il metodo "ProcessAsync".
ViewComponent
 Usufruisce della separazione dei
concetti.
 Ciclo di vita indipendente dai
controller.
 Dipendono solo dai parametri passati
in input.
ViewComponent: Menu
ViewComponent: Menu
ViewComponent: Menu
ViewComponent: Invocazione
ViewComponent: Render Html
Asp Net Core MVC
Asp Net Core Razor Page
Caso d'uso
Model View Controller Pattern
Asp Net Core Razor Page
Asp Net Core Razor Page: Index
Asp Net Core Razor Page: Create
Razor Page: Single File
Razor Page: View
Razor Page:View
Razor Page: Model Binding
Razor Page: PageModel
Razor Page: Handler Named Methods
Razor Page: Handler Named Methods
RazorPage: PageRouteModel
Razor Page: PageRouteModel
Razor Page: RoutePageModel
Razor Page: PageRouteModel
Razor Page: RoutePageModel
Razor Page: RoutePageModel
 Creare una classe che
implementi l'interfaccia:
"IPageRouteModelConvention".
 Implementare il metodo
"Apply".
 Registrare la classe creata tra le
convenzioni delle Razor Pages.
Riferimenti
• Obscure Bugs: ASP.NET MVC Child Actions
• Page Object Model (POM) | Design Pattern
• Writing flexible code in ASP.NET Core 2.0 Razor Pages
• Razor Pages - Understanding Handler Methods
• Utilizzare servizi applicativi durante la validazione in ASP.NET Core
• An introduction to ASP.NET Core Razor Pages
• Scrutor - NuGet Package
• Using Scrutor to automatically register your services with the ASP.NET Core
DI container
• StaticFileMiddleware.cs - Repository GitHub
• Repository della Demo
Mauro Di Liddo
.NET Developer
Mauro.diliddo@hotmail.it
linkedin.com/in/maurodiliddo/
https://Speakingcodes.com

Weitere ähnliche Inhalte

Ähnlich wie Talk introduzioneaspnetcore

Cert03 70-486 developing asp.net mvc 4 web applications
Cert03   70-486 developing asp.net mvc 4 web applicationsCert03   70-486 developing asp.net mvc 4 web applications
Cert03 70-486 developing asp.net mvc 4 web applicationsDotNetCampus
 
Meetup DotNetCode Settembre 2018 - ASP.NET Core 2.1
Meetup DotNetCode Settembre 2018 - ASP.NET Core 2.1Meetup DotNetCode Settembre 2018 - ASP.NET Core 2.1
Meetup DotNetCode Settembre 2018 - ASP.NET Core 2.1dotnetcode
 
Hands on MVC - Mastering the Web
Hands on MVC - Mastering the WebHands on MVC - Mastering the Web
Hands on MVC - Mastering the WebClaudio Gandelli
 
Blazor with .net 5 - di Gerardo Greco
Blazor with .net 5 - di Gerardo GrecoBlazor with .net 5 - di Gerardo Greco
Blazor with .net 5 - di Gerardo GrecoGiuneco S.r.l
 
What's New in ASP.NET 4.5 and Visual Studio 2012
What's New in ASP.NET 4.5 and Visual Studio 2012What's New in ASP.NET 4.5 and Visual Studio 2012
What's New in ASP.NET 4.5 and Visual Studio 2012Andrea Dottor
 
Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0Alessandro Forte
 
Meetup Azure DevOps
Meetup Azure DevOpsMeetup Azure DevOps
Meetup Azure DevOpsdotnetcode
 
Meetup Azure DevOps
Meetup Azure DevOpsMeetup Azure DevOps
Meetup Azure DevOpsdotnetcode
 
ASP.NET MVC 6 - uno sguardo al futuro
ASP.NET MVC 6 - uno sguardo al futuroASP.NET MVC 6 - uno sguardo al futuro
ASP.NET MVC 6 - uno sguardo al futuroAndrea Dottor
 
Sviluppo di servizi REST per Android - Luca Masini
Sviluppo di servizi REST per Android - Luca Masini Sviluppo di servizi REST per Android - Luca Masini
Sviluppo di servizi REST per Android - Luca Masini Whymca
 
SVILUPPO DI SERVIZI REST PER ANDROID
SVILUPPO DI SERVIZI REST PER ANDROIDSVILUPPO DI SERVIZI REST PER ANDROID
SVILUPPO DI SERVIZI REST PER ANDROIDLuca Masini
 
ASP.NET Core - dove siamo arrivati
ASP.NET Core - dove siamo arrivatiASP.NET Core - dove siamo arrivati
ASP.NET Core - dove siamo arrivatiAndrea Dottor
 
Sviluppare Azure Web Apps
Sviluppare Azure Web AppsSviluppare Azure Web Apps
Sviluppare Azure Web AppsAndrea Dottor
 
Designing with microservices - Daniele Mondello
Designing with microservices - Daniele MondelloDesigning with microservices - Daniele Mondello
Designing with microservices - Daniele MondelloDaniele Mondello
 
AngularJS – Reinventare le applicazioni web
AngularJS – Reinventare le applicazioni webAngularJS – Reinventare le applicazioni web
AngularJS – Reinventare le applicazioni webLuca Milan
 

Ähnlich wie Talk introduzioneaspnetcore (20)

Cert03 70-486 developing asp.net mvc 4 web applications
Cert03   70-486 developing asp.net mvc 4 web applicationsCert03   70-486 developing asp.net mvc 4 web applications
Cert03 70-486 developing asp.net mvc 4 web applications
 
Meetup DotNetCode Settembre 2018 - ASP.NET Core 2.1
Meetup DotNetCode Settembre 2018 - ASP.NET Core 2.1Meetup DotNetCode Settembre 2018 - ASP.NET Core 2.1
Meetup DotNetCode Settembre 2018 - ASP.NET Core 2.1
 
Hands on MVC - Mastering the Web
Hands on MVC - Mastering the WebHands on MVC - Mastering the Web
Hands on MVC - Mastering the Web
 
Swagger per tutti
Swagger per tuttiSwagger per tutti
Swagger per tutti
 
Novità di Asp.Net 4.0
Novità di Asp.Net 4.0Novità di Asp.Net 4.0
Novità di Asp.Net 4.0
 
Blazor with .net 5 - di Gerardo Greco
Blazor with .net 5 - di Gerardo GrecoBlazor with .net 5 - di Gerardo Greco
Blazor with .net 5 - di Gerardo Greco
 
What's New in ASP.NET 4.5 and Visual Studio 2012
What's New in ASP.NET 4.5 and Visual Studio 2012What's New in ASP.NET 4.5 and Visual Studio 2012
What's New in ASP.NET 4.5 and Visual Studio 2012
 
Asp.Net MVC 5
Asp.Net MVC 5Asp.Net MVC 5
Asp.Net MVC 5
 
Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0
 
Meetup Azure DevOps
Meetup Azure DevOpsMeetup Azure DevOps
Meetup Azure DevOps
 
Meetup Azure DevOps
Meetup Azure DevOpsMeetup Azure DevOps
Meetup Azure DevOps
 
ASP.NET MVC 6 - uno sguardo al futuro
ASP.NET MVC 6 - uno sguardo al futuroASP.NET MVC 6 - uno sguardo al futuro
ASP.NET MVC 6 - uno sguardo al futuro
 
Sviluppo di servizi REST per Android - Luca Masini
Sviluppo di servizi REST per Android - Luca Masini Sviluppo di servizi REST per Android - Luca Masini
Sviluppo di servizi REST per Android - Luca Masini
 
SVILUPPO DI SERVIZI REST PER ANDROID
SVILUPPO DI SERVIZI REST PER ANDROIDSVILUPPO DI SERVIZI REST PER ANDROID
SVILUPPO DI SERVIZI REST PER ANDROID
 
ASP.NET Core - dove siamo arrivati
ASP.NET Core - dove siamo arrivatiASP.NET Core - dove siamo arrivati
ASP.NET Core - dove siamo arrivati
 
Powerful asp.net 4 e ie9
Powerful asp.net 4 e ie9Powerful asp.net 4 e ie9
Powerful asp.net 4 e ie9
 
Sviluppare Azure Web Apps
Sviluppare Azure Web AppsSviluppare Azure Web Apps
Sviluppare Azure Web Apps
 
Web frameworks
Web frameworksWeb frameworks
Web frameworks
 
Designing with microservices - Daniele Mondello
Designing with microservices - Daniele MondelloDesigning with microservices - Daniele Mondello
Designing with microservices - Daniele Mondello
 
AngularJS – Reinventare le applicazioni web
AngularJS – Reinventare le applicazioni webAngularJS – Reinventare le applicazioni web
AngularJS – Reinventare le applicazioni web
 

Talk introduzioneaspnetcore