SlideShare ist ein Scribd-Unternehmen logo
1 von 20
.NET Core e Linux per il Mobile
Pietro Libro
ROME 24-25 MARCH 2017
About me 
• Senior Software Engineer
• Systems Test Development
• Project Leader for Factory 4.0 MES
• http://www.gfms.com/country_CH/
LinkedIn: https://www.linkedin.com/in/pietrolibro/
Blog: http://blogs.ugidotnet.org/PietroLibroBlog
DomusDotNet: http://www.domusdotnet.org/
Agenda
• .NET Core
• .NET Core: Linux
• ASP.NET Core
• Deployment, 2 scenari
• Microsoft Azure App Service
• Amazon Linux Virtual Machine
• Client: Xamarin Android
• Question Time
.NET Core
• Piattaforma Cross-Platform, gestita da Microsoft e Community GitHub
• Windows, Linux, macOS, IoT, embedded, cloud etc..• Q
• Distribuzione Flessibile
• Riga di comando
• Versione Cross-Platform del .NET Framework (al livello di BCL)
• Fornisce subset di API disponibili in .NET Framework, Xamarin/Mono
• Implementa le specifiche .NET Standard Library
• Open Source: Licenza MIT e APACHE 2, documentazione tramite CC-BY
• Supportato da Microsoft
.NET Core
• Linguaggi supportati: C# e F#
• Di base un singolo modello di applicazione «Console Apps»(testo), su cui
sono stati costruiti modelli aggiuntivi:
• ASP.NET Core (parleremo oggi)
• Piattaforma UWP (Universal Windows Platform) per Windows 10
• Xamarin.Forms
• Composto da:
• Microsoft .NET Core Runtime
• Framework libraries
• Microsoft .NET Core SDK  Per iniziare
• .NET «app host» -> .NET Core Apps
• Altre versioni, pre-release: https://tinyurl.com/zd6lmla
• .NET Core Installation Guide: https://tinyurl.com/hurwe8f
• Per le Demo:
• Sviluppo: .NET Core 1.1.1 con SDK 1.0.1 del 2017.03.07 (VS 2017)
.NET Core
.NET Core: Linux
• Versioni minime supportate (https://tinyurl.com/hurwe8f):
• Red Hat Enterprise Linux 7 Server
• Ubuntu 14.04, 16.04 e Linux Mint 17
• Debian 8.x
• Fedora 23
• CentOS 7.1 & Oracle Linux 7.1
• openSUSE 13.2
• Distribuzione demo: Debian 8.7.1 su Hyper-V
• Download iso: https://tinyurl.com/26plvas
• Installazione e prima applicazione .NET Core in soli 3 steps!
ASP.NET Core
• Modello di applicazione Web-Oriented
• Composto da moduli con minimo overhead e massima flessibilità nella
«costruzione» della propria applicazione
• Astrazione tramite interface
• Non piu’ basato su System.Web.dll
• Basato su package NuGet da includere secondo le necessità
• Principali vantaggi:
• Integrazione dei framework lato client (Grunt, Gulp, Knockout etc.)
• HTTP (Request) pipeline leggera e modulare
• Host in IIS o in un proprio processo
• Built-in Dependency Injection
• Unico path per Web UI (MVC) e Web APIs (RESTful applications)
• Per iniziare:
• ASP.NET Core Getting Started: https://www.asp.net/core
Demo
«.NET Core & ASP.NET Core App»
ASP.NET Core
• ASP.NET «Core App» è una «Console App» con Web Server nel «Main»
• Kestrel, cross-platform Web Server per ASP.NET Core basato su libuv
• Libuv, cross-platform async I/O library: https://tinyurl.com/k2hdq7y
• Possono essere utilizzati altri Web Server: https://tinyurl.com/hz6njyj
• «Startup» class
• Configurazione Request Pipeline: Configure (Middleware)
• Static File
• Authentication
• Routing
• …
• Configurazione Servizi: ConfigureServices (Dependeny Injection)
• ASP.NET MVC Core
• Entity Framework Core
• Identity
• …
ASP.NET Core: Pipeline
Middleware: https://tinyurl.com/zo79fty
Demo
«CodeMotion2017 Blog Api»
Deployment
Due possibili scenari:
• Continuous Deployment su Azure:
• Creazione Account su Azure (anche Trial)
• Configurazione Azure Service App
• Configurazione Git Repository
• Configurazione Visual Studio Code
• Docs: https://tinyurl.com/zbybrnk
• Deployment su Linux Virtual Machine (Ubuntu Server 14.04, Amazon)
• Creazione Account su Amazon Web Service (anche Trial)
• Configurazione Putty
• Installazione .NET Core runtime
• Configurazione HTTP Reverse Proxy (nginx)
• Configurazione Filezilla (o script automatico)
Ambienti «confezionati» per la Demo per esigenze temporali
Demo
Pubblicazione su «Azure App Service» e «Amazon Linux Virtual Machine»
Client: Xamarin Android
Applicazione Xamarin Android in Visual Studio 2017
Demo
«CM Blog Api Client» (Xamarin Android Client)
Toolbox
• Visual Studio Code
• Editor potente e flessibile eseguibile in ambiente Windows, macOS, Linux
• Download: https://code.visualstudio.com/
• Estensibile e Personalizzabile, GIT built-in, IntelliSense, Debugging
• Entity-Framework Core (O/RM)
• Leggero, Estensibile Cross-Platform
• MSSQL, SQLite, DB2, MySQL, SQL Server Compact, PostgreSQL, InMemory
• Code First, DB-First
• https://tinyurl.com/jcha2p6
• NGINX: HTTP e Reverse Proxy Server - https://nginx.org/en/
• Putty: SSH e TelNet client - http://www.putty.org/
• Filezilla: https://filezilla-project.org/
• Microsoft Azure: Piattaforma e Servizi di Cloud Computing
• https://portal.azure.com
• f
• Amazon Web Services: Piattaforma e Servizi di Cloud Computing
• https://aws.amazon.com
Question Time
Entity Framework (EF) Core
Paragone con il «fratello maggiore»:
https://docs.microsoft.com/en-us/ef/efcore-and-ef6/
Install-Package Microsoft.EntityFrameworkCore.Sqlite
Aggiunta EF Tools per gestione database
Install-Package Microsoft.EntityFrameworkCore.Tools -Version
1.1.0-msbuild3-final
Nella demo creiamo un DB partendo dal codice
E’ ovviamente anche possibile partire da un database esistente dal
quale estrarre il modello:
https://docs.microsoft.com/en-us/ef/core/get-
started/aspnetcore/existing-db
Entity Framework (EF) Core
EF Core è un O/RM
Leggero
Estensibile
Cross-platform
Supporto a: MSSQL, SQLite, DB2, MySQL, SQL Server Compact,
PostgreSQL, InMemory, MyCat…e custom
Docs ed esempi: https://docs.microsoft.com/en-us/ef/
Aggiunta EF Core per SQLite al progetto
Install-Package Microsoft.EntityFrameworkCore.Sqlite
Aggiunta EF Tools per gestione database
Install-Package Microsoft.EntityFrameworkCore.Tools -Version
1.1.0-msbuild3-final

Weitere ähnliche Inhalte

Was ist angesagt?

ASP.NET Core - dove siamo arrivati
ASP.NET Core - dove siamo arrivatiASP.NET Core - dove siamo arrivati
ASP.NET Core - dove siamo arrivatiAndrea Dottor
 
Christmas greetings cards with blazor
Christmas greetings cards with blazorChristmas greetings cards with blazor
Christmas greetings cards with blazorNicolò Carandini
 
2015.04.23 Azure Community Bootcamp 2015 Keynote Italy
2015.04.23 Azure Community Bootcamp 2015 Keynote Italy2015.04.23 Azure Community Bootcamp 2015 Keynote Italy
2015.04.23 Azure Community Bootcamp 2015 Keynote ItalyMarco Parenzan
 
Nat come esporre servizi https senza esporre l'applicazione
Nat come esporre servizi https senza esporre l'applicazioneNat come esporre servizi https senza esporre l'applicazione
Nat come esporre servizi https senza esporre l'applicazioneGiuliano Latini
 
ASP.NET performance optimization
ASP.NET performance optimizationASP.NET performance optimization
ASP.NET performance optimizationAndrea Dottor
 
Dal RenderFragment ai Generics, tips for Blazor developers
Dal RenderFragment ai Generics, tips for Blazor developersDal RenderFragment ai Generics, tips for Blazor developers
Dal RenderFragment ai Generics, tips for Blazor developersAndrea Dottor
 
.NET Core, ASP.NET Core e Linux per il Mobile
.NET Core, ASP.NET Core e Linux per il Mobile.NET Core, ASP.NET Core e Linux per il Mobile
.NET Core, ASP.NET Core e Linux per il MobilePietro Libro
 
Introduzione a Service Fabric e Actor Model
Introduzione a Service Fabric e Actor ModelIntroduzione a Service Fabric e Actor Model
Introduzione a Service Fabric e Actor ModelAndrea Tosato
 
Introduzione ad ASP.NET Core
Introduzione ad ASP.NET CoreIntroduzione ad ASP.NET Core
Introduzione ad ASP.NET CoreAndrea Dottor
 
Blazor: are we ready for the launch?
Blazor: are we ready for the launch?Blazor: are we ready for the launch?
Blazor: are we ready for the launch?Andrea Agnoletto
 
Blazor per uno sviluppatore Web Form
Blazor per uno sviluppatore Web FormBlazor per uno sviluppatore Web Form
Blazor per uno sviluppatore Web FormAndrea Dottor
 
Multi-Device Hybrid Apps con Visual Studio e Apache Cordova
Multi-Device Hybrid Apps con Visual Studio e Apache CordovaMulti-Device Hybrid Apps con Visual Studio e Apache Cordova
Multi-Device Hybrid Apps con Visual Studio e Apache CordovaAndrea Dottor
 
Monitoring Applications in AKS
Monitoring Applications in AKSMonitoring Applications in AKS
Monitoring Applications in AKSGiuliano Latini
 
Deploy & Run on Azure App Service
Deploy & Run on Azure App ServiceDeploy & Run on Azure App Service
Deploy & Run on Azure App ServiceAndrea Dottor
 
Windows azure - abbattere tempi e costi di sviluppo
Windows azure - abbattere tempi e costi di sviluppoWindows azure - abbattere tempi e costi di sviluppo
Windows azure - abbattere tempi e costi di sviluppoAndrea Dottor
 
Back to the Future: Migrare da WebForm ad ASP.NET Core gradualmente
Back to the Future: Migrare da WebForm ad ASP.NET Core gradualmente Back to the Future: Migrare da WebForm ad ASP.NET Core gradualmente
Back to the Future: Migrare da WebForm ad ASP.NET Core gradualmente Andrea Dottor
 
[Alam aeki] Guida illustrata alla modellazione di un dominio con Event Sourci...
[Alam aeki] Guida illustrata alla modellazione di un dominio con Event Sourci...[Alam aeki] Guida illustrata alla modellazione di un dominio con Event Sourci...
[Alam aeki] Guida illustrata alla modellazione di un dominio con Event Sourci...Andrea Balducci
 
Blazor ha vinto? Storie di casi reali
Blazor ha vinto? Storie di casi realiBlazor ha vinto? Storie di casi reali
Blazor ha vinto? Storie di casi realiAndrea Dottor
 

Was ist angesagt? (20)

ASP.NET Core - dove siamo arrivati
ASP.NET Core - dove siamo arrivatiASP.NET Core - dove siamo arrivati
ASP.NET Core - dove siamo arrivati
 
Christmas greetings cards with blazor
Christmas greetings cards with blazorChristmas greetings cards with blazor
Christmas greetings cards with blazor
 
2015.04.23 Azure Community Bootcamp 2015 Keynote Italy
2015.04.23 Azure Community Bootcamp 2015 Keynote Italy2015.04.23 Azure Community Bootcamp 2015 Keynote Italy
2015.04.23 Azure Community Bootcamp 2015 Keynote Italy
 
Nat come esporre servizi https senza esporre l'applicazione
Nat come esporre servizi https senza esporre l'applicazioneNat come esporre servizi https senza esporre l'applicazione
Nat come esporre servizi https senza esporre l'applicazione
 
Microsoft Fast - Overview
Microsoft Fast - OverviewMicrosoft Fast - Overview
Microsoft Fast - Overview
 
ASP.NET performance optimization
ASP.NET performance optimizationASP.NET performance optimization
ASP.NET performance optimization
 
Dal RenderFragment ai Generics, tips for Blazor developers
Dal RenderFragment ai Generics, tips for Blazor developersDal RenderFragment ai Generics, tips for Blazor developers
Dal RenderFragment ai Generics, tips for Blazor developers
 
.NET Core, ASP.NET Core e Linux per il Mobile
.NET Core, ASP.NET Core e Linux per il Mobile.NET Core, ASP.NET Core e Linux per il Mobile
.NET Core, ASP.NET Core e Linux per il Mobile
 
Introduzione a Service Fabric e Actor Model
Introduzione a Service Fabric e Actor ModelIntroduzione a Service Fabric e Actor Model
Introduzione a Service Fabric e Actor Model
 
Introduzione ad ASP.NET Core
Introduzione ad ASP.NET CoreIntroduzione ad ASP.NET Core
Introduzione ad ASP.NET Core
 
Blazor: are we ready for the launch?
Blazor: are we ready for the launch?Blazor: are we ready for the launch?
Blazor: are we ready for the launch?
 
Blazor per uno sviluppatore Web Form
Blazor per uno sviluppatore Web FormBlazor per uno sviluppatore Web Form
Blazor per uno sviluppatore Web Form
 
Multi-Device Hybrid Apps con Visual Studio e Apache Cordova
Multi-Device Hybrid Apps con Visual Studio e Apache CordovaMulti-Device Hybrid Apps con Visual Studio e Apache Cordova
Multi-Device Hybrid Apps con Visual Studio e Apache Cordova
 
Monitoring Applications in AKS
Monitoring Applications in AKSMonitoring Applications in AKS
Monitoring Applications in AKS
 
Deploy & Run on Azure App Service
Deploy & Run on Azure App ServiceDeploy & Run on Azure App Service
Deploy & Run on Azure App Service
 
Windows azure - abbattere tempi e costi di sviluppo
Windows azure - abbattere tempi e costi di sviluppoWindows azure - abbattere tempi e costi di sviluppo
Windows azure - abbattere tempi e costi di sviluppo
 
Back to the Future: Migrare da WebForm ad ASP.NET Core gradualmente
Back to the Future: Migrare da WebForm ad ASP.NET Core gradualmente Back to the Future: Migrare da WebForm ad ASP.NET Core gradualmente
Back to the Future: Migrare da WebForm ad ASP.NET Core gradualmente
 
[Alam aeki] Guida illustrata alla modellazione di un dominio con Event Sourci...
[Alam aeki] Guida illustrata alla modellazione di un dominio con Event Sourci...[Alam aeki] Guida illustrata alla modellazione di un dominio con Event Sourci...
[Alam aeki] Guida illustrata alla modellazione di un dominio con Event Sourci...
 
Spa with Blazor
Spa with BlazorSpa with Blazor
Spa with Blazor
 
Blazor ha vinto? Storie di casi reali
Blazor ha vinto? Storie di casi realiBlazor ha vinto? Storie di casi reali
Blazor ha vinto? Storie di casi reali
 

Ähnlich wie ASP.NET Core Services e Linux per il Mobile - Pietro Libro - Codemotion Rome 2017

Esplorando il Cloud con Azure - Un viaggio tra IaaS, PaaS e SaaS e un compila...
Esplorando il Cloud con Azure - Un viaggio tra IaaS, PaaS e SaaS e un compila...Esplorando il Cloud con Azure - Un viaggio tra IaaS, PaaS e SaaS e un compila...
Esplorando il Cloud con Azure - Un viaggio tra IaaS, PaaS e SaaS e un compila...Giuseppe Cramarossa
 
Le novita di visual studio 2012
Le novita di visual studio 2012Le novita di visual studio 2012
Le novita di visual studio 2012Crismer La Pignola
 
Costruire applicazioni-cross-platform-con-xamarin-visual-studio-2013
Costruire applicazioni-cross-platform-con-xamarin-visual-studio-2013Costruire applicazioni-cross-platform-con-xamarin-visual-studio-2013
Costruire applicazioni-cross-platform-con-xamarin-visual-studio-2013Luca Zulian
 
Introduzione a DotNetNuke
Introduzione a DotNetNukeIntroduzione a DotNetNuke
Introduzione a DotNetNukeMassimo Bonanni
 
ASP.NET 4.6 e ASP.NET 5...l'evoluzione del web
ASP.NET 4.6 e ASP.NET 5...l'evoluzione del webASP.NET 4.6 e ASP.NET 5...l'evoluzione del web
ASP.NET 4.6 e ASP.NET 5...l'evoluzione del webAndrea Dottor
 
Omnis italianmeeting 2016-10-20
Omnis italianmeeting 2016-10-20Omnis italianmeeting 2016-10-20
Omnis italianmeeting 2016-10-20Romualdo Gobbo
 
Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0Alessandro Forte
 
Designing with microservices - Daniele Mondello
Designing with microservices - Daniele MondelloDesigning with microservices - Daniele Mondello
Designing with microservices - Daniele MondelloDaniele Mondello
 
Azure Web Apps: portare il tuo sito sul cloud
Azure Web Apps: portare il tuo sito sul cloudAzure Web Apps: portare il tuo sito sul cloud
Azure Web Apps: portare il tuo sito sul cloudDavide Benvegnù
 
Writing apps for android with .net
Writing apps for android with .net Writing apps for android with .net
Writing apps for android with .net Leonardo Alario
 
Sviluppo Web Agile Con MonoRail
Sviluppo Web Agile Con MonoRailSviluppo Web Agile Con MonoRail
Sviluppo Web Agile Con MonoRailStefano Ottaviani
 
Antica presentazione AJAX
Antica presentazione AJAXAntica presentazione AJAX
Antica presentazione AJAXTommaso Torti
 
CruiseControl.net in un progetto reale
CruiseControl.net in un progetto realeCruiseControl.net in un progetto reale
CruiseControl.net in un progetto realeDotNetMarche
 
Crea servizi REST per la tua App con ASP.NET 5
Crea servizi REST per la tua App con ASP.NET 5Crea servizi REST per la tua App con ASP.NET 5
Crea servizi REST per la tua App con ASP.NET 5Andrea Dottor
 
Real world Visual Studio Code
Real world Visual Studio CodeReal world Visual Studio Code
Real world Visual Studio CodeRoberto Messora
 
Asp.net web api reloaded
Asp.net web api reloadedAsp.net web api reloaded
Asp.net web api reloadedPietro Libro
 

Ähnlich wie ASP.NET Core Services e Linux per il Mobile - Pietro Libro - Codemotion Rome 2017 (20)

Da DotNet a DotNetCore
Da DotNet a DotNetCoreDa DotNet a DotNetCore
Da DotNet a DotNetCore
 
Esplorando il Cloud con Azure - Un viaggio tra IaaS, PaaS e SaaS e un compila...
Esplorando il Cloud con Azure - Un viaggio tra IaaS, PaaS e SaaS e un compila...Esplorando il Cloud con Azure - Un viaggio tra IaaS, PaaS e SaaS e un compila...
Esplorando il Cloud con Azure - Un viaggio tra IaaS, PaaS e SaaS e un compila...
 
Le novita di visual studio 2012
Le novita di visual studio 2012Le novita di visual studio 2012
Le novita di visual studio 2012
 
Costruire applicazioni-cross-platform-con-xamarin-visual-studio-2013
Costruire applicazioni-cross-platform-con-xamarin-visual-studio-2013Costruire applicazioni-cross-platform-con-xamarin-visual-studio-2013
Costruire applicazioni-cross-platform-con-xamarin-visual-studio-2013
 
INTRO TO XAMARIN
INTRO TO XAMARININTRO TO XAMARIN
INTRO TO XAMARIN
 
Introduzione a DotNetNuke
Introduzione a DotNetNukeIntroduzione a DotNetNuke
Introduzione a DotNetNuke
 
ASP.NET 4.6 e ASP.NET 5...l'evoluzione del web
ASP.NET 4.6 e ASP.NET 5...l'evoluzione del webASP.NET 4.6 e ASP.NET 5...l'evoluzione del web
ASP.NET 4.6 e ASP.NET 5...l'evoluzione del web
 
Omnis italianmeeting 2016-10-20
Omnis italianmeeting 2016-10-20Omnis italianmeeting 2016-10-20
Omnis italianmeeting 2016-10-20
 
ASP.NET Core essentials
ASP.NET Core essentialsASP.NET Core essentials
ASP.NET Core essentials
 
XeDotNet - .Net MAUI
XeDotNet - .Net MAUIXeDotNet - .Net MAUI
XeDotNet - .Net MAUI
 
Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0Alessandro Forte - ASP.Net 4.0
Alessandro Forte - ASP.Net 4.0
 
Designing with microservices - Daniele Mondello
Designing with microservices - Daniele MondelloDesigning with microservices - Daniele Mondello
Designing with microservices - Daniele Mondello
 
Azure Web Apps: portare il tuo sito sul cloud
Azure Web Apps: portare il tuo sito sul cloudAzure Web Apps: portare il tuo sito sul cloud
Azure Web Apps: portare il tuo sito sul cloud
 
Writing apps for android with .net
Writing apps for android with .net Writing apps for android with .net
Writing apps for android with .net
 
Sviluppo Web Agile Con MonoRail
Sviluppo Web Agile Con MonoRailSviluppo Web Agile Con MonoRail
Sviluppo Web Agile Con MonoRail
 
Antica presentazione AJAX
Antica presentazione AJAXAntica presentazione AJAX
Antica presentazione AJAX
 
CruiseControl.net in un progetto reale
CruiseControl.net in un progetto realeCruiseControl.net in un progetto reale
CruiseControl.net in un progetto reale
 
Crea servizi REST per la tua App con ASP.NET 5
Crea servizi REST per la tua App con ASP.NET 5Crea servizi REST per la tua App con ASP.NET 5
Crea servizi REST per la tua App con ASP.NET 5
 
Real world Visual Studio Code
Real world Visual Studio CodeReal world Visual Studio Code
Real world Visual Studio Code
 
Asp.net web api reloaded
Asp.net web api reloadedAsp.net web api reloaded
Asp.net web api reloaded
 

Mehr von Codemotion

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Codemotion
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyCodemotion
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaCodemotion
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserCodemotion
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Codemotion
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Codemotion
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Codemotion
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 - Codemotion
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Codemotion
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Codemotion
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Codemotion
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Codemotion
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Codemotion
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Codemotion
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Codemotion
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...Codemotion
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Codemotion
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Codemotion
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Codemotion
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Codemotion
 

Mehr von Codemotion (20)

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending story
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storia
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard Altwasser
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
 

ASP.NET Core Services e Linux per il Mobile - Pietro Libro - Codemotion Rome 2017

  • 1. .NET Core e Linux per il Mobile Pietro Libro ROME 24-25 MARCH 2017
  • 2. About me  • Senior Software Engineer • Systems Test Development • Project Leader for Factory 4.0 MES • http://www.gfms.com/country_CH/ LinkedIn: https://www.linkedin.com/in/pietrolibro/ Blog: http://blogs.ugidotnet.org/PietroLibroBlog DomusDotNet: http://www.domusdotnet.org/
  • 3. Agenda • .NET Core • .NET Core: Linux • ASP.NET Core • Deployment, 2 scenari • Microsoft Azure App Service • Amazon Linux Virtual Machine • Client: Xamarin Android • Question Time
  • 4. .NET Core • Piattaforma Cross-Platform, gestita da Microsoft e Community GitHub • Windows, Linux, macOS, IoT, embedded, cloud etc..• Q • Distribuzione Flessibile • Riga di comando • Versione Cross-Platform del .NET Framework (al livello di BCL) • Fornisce subset di API disponibili in .NET Framework, Xamarin/Mono • Implementa le specifiche .NET Standard Library • Open Source: Licenza MIT e APACHE 2, documentazione tramite CC-BY • Supportato da Microsoft
  • 5. .NET Core • Linguaggi supportati: C# e F# • Di base un singolo modello di applicazione «Console Apps»(testo), su cui sono stati costruiti modelli aggiuntivi: • ASP.NET Core (parleremo oggi) • Piattaforma UWP (Universal Windows Platform) per Windows 10 • Xamarin.Forms • Composto da: • Microsoft .NET Core Runtime • Framework libraries • Microsoft .NET Core SDK  Per iniziare • .NET «app host» -> .NET Core Apps • Altre versioni, pre-release: https://tinyurl.com/zd6lmla • .NET Core Installation Guide: https://tinyurl.com/hurwe8f • Per le Demo: • Sviluppo: .NET Core 1.1.1 con SDK 1.0.1 del 2017.03.07 (VS 2017)
  • 7. .NET Core: Linux • Versioni minime supportate (https://tinyurl.com/hurwe8f): • Red Hat Enterprise Linux 7 Server • Ubuntu 14.04, 16.04 e Linux Mint 17 • Debian 8.x • Fedora 23 • CentOS 7.1 & Oracle Linux 7.1 • openSUSE 13.2 • Distribuzione demo: Debian 8.7.1 su Hyper-V • Download iso: https://tinyurl.com/26plvas • Installazione e prima applicazione .NET Core in soli 3 steps!
  • 8. ASP.NET Core • Modello di applicazione Web-Oriented • Composto da moduli con minimo overhead e massima flessibilità nella «costruzione» della propria applicazione • Astrazione tramite interface • Non piu’ basato su System.Web.dll • Basato su package NuGet da includere secondo le necessità • Principali vantaggi: • Integrazione dei framework lato client (Grunt, Gulp, Knockout etc.) • HTTP (Request) pipeline leggera e modulare • Host in IIS o in un proprio processo • Built-in Dependency Injection • Unico path per Web UI (MVC) e Web APIs (RESTful applications) • Per iniziare: • ASP.NET Core Getting Started: https://www.asp.net/core
  • 9. Demo «.NET Core & ASP.NET Core App»
  • 10. ASP.NET Core • ASP.NET «Core App» è una «Console App» con Web Server nel «Main» • Kestrel, cross-platform Web Server per ASP.NET Core basato su libuv • Libuv, cross-platform async I/O library: https://tinyurl.com/k2hdq7y • Possono essere utilizzati altri Web Server: https://tinyurl.com/hz6njyj • «Startup» class • Configurazione Request Pipeline: Configure (Middleware) • Static File • Authentication • Routing • … • Configurazione Servizi: ConfigureServices (Dependeny Injection) • ASP.NET MVC Core • Entity Framework Core • Identity • …
  • 11. ASP.NET Core: Pipeline Middleware: https://tinyurl.com/zo79fty
  • 13. Deployment Due possibili scenari: • Continuous Deployment su Azure: • Creazione Account su Azure (anche Trial) • Configurazione Azure Service App • Configurazione Git Repository • Configurazione Visual Studio Code • Docs: https://tinyurl.com/zbybrnk • Deployment su Linux Virtual Machine (Ubuntu Server 14.04, Amazon) • Creazione Account su Amazon Web Service (anche Trial) • Configurazione Putty • Installazione .NET Core runtime • Configurazione HTTP Reverse Proxy (nginx) • Configurazione Filezilla (o script automatico) Ambienti «confezionati» per la Demo per esigenze temporali
  • 14. Demo Pubblicazione su «Azure App Service» e «Amazon Linux Virtual Machine»
  • 15. Client: Xamarin Android Applicazione Xamarin Android in Visual Studio 2017
  • 16. Demo «CM Blog Api Client» (Xamarin Android Client)
  • 17. Toolbox • Visual Studio Code • Editor potente e flessibile eseguibile in ambiente Windows, macOS, Linux • Download: https://code.visualstudio.com/ • Estensibile e Personalizzabile, GIT built-in, IntelliSense, Debugging • Entity-Framework Core (O/RM) • Leggero, Estensibile Cross-Platform • MSSQL, SQLite, DB2, MySQL, SQL Server Compact, PostgreSQL, InMemory • Code First, DB-First • https://tinyurl.com/jcha2p6 • NGINX: HTTP e Reverse Proxy Server - https://nginx.org/en/ • Putty: SSH e TelNet client - http://www.putty.org/ • Filezilla: https://filezilla-project.org/ • Microsoft Azure: Piattaforma e Servizi di Cloud Computing • https://portal.azure.com • f • Amazon Web Services: Piattaforma e Servizi di Cloud Computing • https://aws.amazon.com
  • 19. Entity Framework (EF) Core Paragone con il «fratello maggiore»: https://docs.microsoft.com/en-us/ef/efcore-and-ef6/ Install-Package Microsoft.EntityFrameworkCore.Sqlite Aggiunta EF Tools per gestione database Install-Package Microsoft.EntityFrameworkCore.Tools -Version 1.1.0-msbuild3-final Nella demo creiamo un DB partendo dal codice E’ ovviamente anche possibile partire da un database esistente dal quale estrarre il modello: https://docs.microsoft.com/en-us/ef/core/get- started/aspnetcore/existing-db
  • 20. Entity Framework (EF) Core EF Core è un O/RM Leggero Estensibile Cross-platform Supporto a: MSSQL, SQLite, DB2, MySQL, SQL Server Compact, PostgreSQL, InMemory, MyCat…e custom Docs ed esempi: https://docs.microsoft.com/en-us/ef/ Aggiunta EF Core per SQLite al progetto Install-Package Microsoft.EntityFrameworkCore.Sqlite Aggiunta EF Tools per gestione database Install-Package Microsoft.EntityFrameworkCore.Tools -Version 1.1.0-msbuild3-final