SlideShare a Scribd company logo
1 of 26
Download to read offline
.NET Core + ASP.NET Core Training Course
Session 18
.NET Core
What we learned?
Session 6 ~ 16 Overview
• ASP.NET Core Basics
• Middleware, Controllers, Action Filters and Routing
• Models
• Views
• Entity Framework Core
.NET Core
What we’ll learn today?
Session 16 Agenda
• Welcome to ASP.NET Core 1.1
.NET Core
Changelog
ASP.NET Core 1.1
Performance
• ASP.NET Core running on Linux is approximately 760 times faster than it was one
year ago (TechEmpower benchmarks)
.NET Core
Changelog
ASP.NET Core 1.1
What’s New
• Improved and cross-platform compatible site hosting capabilities when using a
host other than Windows Internet Information Server (IIS).
• Support for developing with native Windows capabilities
• Compatibility, portability and performance of middleware and other MVC
features throughout the UI framework
• Improved deployment and management experience of ASP.NET Core
applications on Microsoft Azure. We think these improvements help make
ASP.NET Core the best choice for developing an application for the cloud.
.NET Core
Changelog
ASP.NET Core 1.1
What’s New
• Improved and cross-platform compatible site hosting capabilities when using a
host other than Windows Internet Information Server (IIS).
• Support for developing with native Windows capabilities
• Compatibility, portability and performance of middleware and other MVC
features throughout the UI framework
• Improved deployment and management experience of ASP.NET Core
applications on Microsoft Azure. We think these improvements help make
ASP.NET Core the best choice for developing an application for the cloud.
.NET Core
URL Rewriting Middleware
ASP.NET Core 1.1
URL rewriting functionality to ASP.NET Core through a middleware component that
can be configured using IIS standard XML formatted rules, Apache Mod_Rewrite
syntax, or some simple C# methods coded into your application.
When you want to run your ASP.NET Core application outside of IIS, we want to
enable those same rich URL rewriting capabilities regardless of the web host you
are using. If you are using containers, Apache, or nginx you will be able to have
ASP.NET Core manage this capability for you with a uniform syntax that you are
familiar with.
.NET Core
URL Rewriting Middleware
ASP.NET Core 1.1
URL Rewriting allows mapping a public URL space, designed for consumption of
your clients, to whatever representation the downstream components of your
middleware pipeline require as well as redirecting clients to different URLs based
on a pattern.
For example, you could ensure a canonical hostname by rewriting any requests to
http://example.com to instead be http://www.example.com for everything after the re-write rules
have run. Another example is to redirect all requests to http://example.com to https://example.com.
You can even configure URL rewrite such that both rules are applied and all requests to
example.com are always redirected to SSL and rewritten to www.
.NET Core
URL Rewriting Middleware
ASP.NET Core 1.1
• Url Redirect sends an HTTP 301 Moved Permanently status code to the client with the new address
• Url Rewrite gives a different URL to the next steps in the HTTP pipeline, tricking it into thinking a different
address was requested.
.NET Core
Response Caching Middleware
ASP.NET Core 1.1
Response Caching similar to the OutputCache capabilities of previous ASP.NET releases can
now be activated in your application by adding the Microsoft.AspNetCore.ResponseCaching
and the Microsoft.Extensions.Caching.Memory packages to your application. You can add
this middleware to your application in the Startup.ConfigureServices method and configure
the response caching from the Startup.Configure method.
You can now add GZipCompression to the ASP.NET HTTP Pipeline if you would like ASP.NET
to do your compression instead of a front-end web server. IIS would have normally handled
this for you, but in environments where your host does not provide compression capabilities,
ASP.NET Core can do this for you.
.NET Core
Response Caching Middleware
ASP.NET Core 1.1
Microsoft.AspNetCore.ResponseCompression package
.NET Core
WebListener Server for Windows
ASP.NET Core 1.1
WebListener is a server that runs directly on top of the Windows Http Server API.
WebListener gives you the option to take advantage of Windows specific features, like
• support for Windows authentication
• port sharing
• HTTPS with SNI
• HTTP/2 over TLS (Windows 10)
• direct file transmission
• response caching WebSockets (Windows 8)
This may be advantageous for you
if you want to bundle an ASP.NET
Core microservice in a Windows
container that takes advantage of
these Windows features.
.NET Core
WebListener Server for Windows
ASP.NET Core 1.1
On Windows you can use this server instead of Kestrel by referencing the
Microsoft.AspNetCore.Server.WebListener package instead of the Kestrel package and
configuring your WebHostBuilder to use Weblistener instead of Kestrel:
.NET Core
View Components as Tag Helpers
ASP.NET Core 1.1
ViewComponents are an ASP.NET Core display concept that provides for a razor view
that is triggered from a server-side class that inherits from the ViewComponent base
class. You can now invoke from your views using Tag Helper syntax and get all the
benefits of IntelliSense and Tag Helper tooling in Visual Studio. Previously, to invoke a
View Component from a view you would use the Component.InvokeAsync method and
pass in any View Component arguments using an anonymous object:
@await Component.InvokeAsync("Copyright", new { website = "example.com", year = 2016 })
.NET Core
View Components as Tag Helpers
ASP.NET Core 1.1
With the Component.Invoke syntax, there is no obvious way to add CSS classes or get
tooltips to assist in configuring the component like we have with the TagHelper feature.
Finally, this keeps us in “HTML Editing” mode and allows a developer to avoid shifting
into C# in order to reference a ViewComponent they want to add to a page.
To enable invoking your View Components as Tag Helpers simply add your View
Components as Tag Helpers using the @addTagHelpers directive:
@addTagHelper "*, WebApplication1"
.NET Core
Middleware as MVC filters
ASP.NET Core 1.1
Middleware typically sits in the global request handling pipeline.
You can now apply middleware as an MVC resource filter using the new
MiddlewareFilterAttribute. For example, you could apply response compression or
caching to a specific action, or you might use a route value based request culture
provider to establish the current culture for the request using the localization
middleware.
.NET Core
Middleware as MVC filters
ASP.NET Core 1.1
.NET Core
Middleware as MVC filters
ASP.NET Core 1.1
.NET Core
Cookie-based TempData provider
ASP.NET Core 1.1
To use the cookie-based TempData provider you register the
CookieTempDataProvider service in your ConfigureServices method after adding the
MVC services as follows:
.NET Core
View compilation
ASP.NET Core 1.1
The Razor syntax for views provides a flexible development experience where
compilation of the views happens automatically at runtime when the view is executed.
However, there are some scenarios where you do not want the Razor syntax compiled
at runtime. You can now compile the Razor views that your application references and
deploy them with your application.
.NET Core
View compilation
ASP.NET Core 1.1
To enable view compilation as part of publishing your application,
1. Add a reference to “Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design”
under the “dependencies” section.
2. Add a reference to “Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools”
under the tools section
3. Add a postpublish script to invoke view compiler:
.NET Core
Azure App Service logging provider
ASP.NET Core 1.1
The Microsoft.AspNetCore.AzureAppServicesIntegration package allows your
application to take advantage of App Service specific logging and diagnostics. Any
log messages that are written using the ILogger/ILoggerFactory abstractions will go
to the locations configured in the Diagnostics Logs section of your App Service
configuration in the portal (see screenshot). We highly recommend using this
logging provider when deploying an application to Azure App Service. Prior to this
feature, it was very difficult to capture log files without a third party provider or
hosted service.
.NET Core
Azure Key Vault configuration provider
ASP.NET Core 1.1
Azure Key Vault is a service that can be used to store secret cryptographic keys and
other secrets in a security hardened container on Azure. You can set up your own Key
Vault by following the Getting Started docs. The
Microsoft.Extensions.Configuration.AzureKeyVault package then provides a
configuration provider for your Azure Key Vault. This package allows you to retrieve
configuration from Key Vault secrets on application start and hold it in memory, using
the normal ASP.NET Core configuration abstractions to access the configuration data.
.NET Core
Redis and Azure Storage Data Protection Key Repositories
ASP.NET Core 1.1
The Microsoft.AspNetCore.DataProtection.AzureStorage and
Microsoft.AspNetCore.DataProtection.Redis packages allow storing your Data
Protection keys in Azure Storage or Redis respectively. This allows keys to be shared
across several instances of a web application so that you can share an authentication
cookie, or CSRF protection across many load balanced servers running your ASP.NET
Core application. As data protection is used behind the scenes for a few things in
MVC it’s extremely probable once you start scaling out you will need to share the
keyring. Your options for sharing keys before these two packages would be to use a
network share with a file based key repository.
.NET Core
Redis and Azure Storage Data Protection Key Repositories
ASP.NET Core 1.1
The Microsoft.AspNetCore.DataProtection.AzureStorage and
Microsoft.AspNetCore.DataProtection.Redis packages allow storing your Data
Protection keys in Azure Storage or Redis respectively. This allows keys to be shared
across several instances of a web application so that you can share an authentication
cookie, or CSRF protection across many load balanced servers running your ASP.NET
Core application. As data protection is used behind the scenes for a few things in
MVC it’s extremely probable once you start scaling out you will need to share the
keyring. Your options for sharing keys before these two packages would be to use a
network share with a file based key repository.
.NET Core
Demo
Demo

More Related Content

What's hot

.NET Core, ASP.NET Core Course, Session 12
.NET Core, ASP.NET Core Course, Session 12.NET Core, ASP.NET Core Course, Session 12
.NET Core, ASP.NET Core Course, Session 12aminmesbahi
 
.NET Core, ASP.NET Core Course, Session 17
.NET Core, ASP.NET Core Course, Session 17.NET Core, ASP.NET Core Course, Session 17
.NET Core, ASP.NET Core Course, Session 17aminmesbahi
 
.NET Core, ASP.NET Core Course, Session 15
.NET Core, ASP.NET Core Course, Session 15.NET Core, ASP.NET Core Course, Session 15
.NET Core, ASP.NET Core Course, Session 15aminmesbahi
 
.NET Core, ASP.NET Core Course, Session 6
.NET Core, ASP.NET Core Course, Session 6.NET Core, ASP.NET Core Course, Session 6
.NET Core, ASP.NET Core Course, Session 6aminmesbahi
 
.NET Core, ASP.NET Core Course, Session 9
.NET Core, ASP.NET Core Course, Session 9.NET Core, ASP.NET Core Course, Session 9
.NET Core, ASP.NET Core Course, Session 9aminmesbahi
 
.NET Core, ASP.NET Core Course, Session 3
.NET Core, ASP.NET Core Course, Session 3.NET Core, ASP.NET Core Course, Session 3
.NET Core, ASP.NET Core Course, Session 3aminmesbahi
 
.NET Core, ASP.NET Core Course, Session 2
.NET Core, ASP.NET Core Course, Session 2.NET Core, ASP.NET Core Course, Session 2
.NET Core, ASP.NET Core Course, Session 2aminmesbahi
 
.NET Core, ASP.NET Core Course, Session 1
.NET Core, ASP.NET Core Course, Session 1.NET Core, ASP.NET Core Course, Session 1
.NET Core, ASP.NET Core Course, Session 1aminmesbahi
 
Share point review qustions
Share point review qustionsShare point review qustions
Share point review qustionsthan sare
 
SFDC Inbound Integrations
SFDC Inbound IntegrationsSFDC Inbound Integrations
SFDC Inbound IntegrationsSujit Kumar
 
Hibernate Developer Reference
Hibernate Developer ReferenceHibernate Developer Reference
Hibernate Developer ReferenceMuthuselvam RS
 
Lecture 3: Servlets - Session Management
Lecture 3:  Servlets - Session ManagementLecture 3:  Servlets - Session Management
Lecture 3: Servlets - Session ManagementFahad Golra
 
Microsoft Search Server 2008 - Technical Overview
Microsoft Search Server 2008 - Technical OverviewMicrosoft Search Server 2008 - Technical Overview
Microsoft Search Server 2008 - Technical Overviewukdpe
 
Mike Taulty OData (NxtGen User Group UK)
Mike Taulty OData (NxtGen User Group UK)Mike Taulty OData (NxtGen User Group UK)
Mike Taulty OData (NxtGen User Group UK)ukdpe
 
J2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - ComponentsJ2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - ComponentsKaml Sah
 
Different Types of Containers in Spring
Different Types of Containers in Spring Different Types of Containers in Spring
Different Types of Containers in Spring Sunil kumar Mohanty
 

What's hot (20)

.NET Core, ASP.NET Core Course, Session 12
.NET Core, ASP.NET Core Course, Session 12.NET Core, ASP.NET Core Course, Session 12
.NET Core, ASP.NET Core Course, Session 12
 
.NET Core, ASP.NET Core Course, Session 17
.NET Core, ASP.NET Core Course, Session 17.NET Core, ASP.NET Core Course, Session 17
.NET Core, ASP.NET Core Course, Session 17
 
.NET Core, ASP.NET Core Course, Session 15
.NET Core, ASP.NET Core Course, Session 15.NET Core, ASP.NET Core Course, Session 15
.NET Core, ASP.NET Core Course, Session 15
 
.NET Core, ASP.NET Core Course, Session 6
.NET Core, ASP.NET Core Course, Session 6.NET Core, ASP.NET Core Course, Session 6
.NET Core, ASP.NET Core Course, Session 6
 
.NET Core, ASP.NET Core Course, Session 9
.NET Core, ASP.NET Core Course, Session 9.NET Core, ASP.NET Core Course, Session 9
.NET Core, ASP.NET Core Course, Session 9
 
.NET Core, ASP.NET Core Course, Session 3
.NET Core, ASP.NET Core Course, Session 3.NET Core, ASP.NET Core Course, Session 3
.NET Core, ASP.NET Core Course, Session 3
 
.NET Core, ASP.NET Core Course, Session 2
.NET Core, ASP.NET Core Course, Session 2.NET Core, ASP.NET Core Course, Session 2
.NET Core, ASP.NET Core Course, Session 2
 
.NET Core, ASP.NET Core Course, Session 1
.NET Core, ASP.NET Core Course, Session 1.NET Core, ASP.NET Core Course, Session 1
.NET Core, ASP.NET Core Course, Session 1
 
Share point review qustions
Share point review qustionsShare point review qustions
Share point review qustions
 
SFDC Inbound Integrations
SFDC Inbound IntegrationsSFDC Inbound Integrations
SFDC Inbound Integrations
 
Hibernate Developer Reference
Hibernate Developer ReferenceHibernate Developer Reference
Hibernate Developer Reference
 
Jspprogramming
JspprogrammingJspprogramming
Jspprogramming
 
Lecture 3: Servlets - Session Management
Lecture 3:  Servlets - Session ManagementLecture 3:  Servlets - Session Management
Lecture 3: Servlets - Session Management
 
Microsoft Search Server 2008 - Technical Overview
Microsoft Search Server 2008 - Technical OverviewMicrosoft Search Server 2008 - Technical Overview
Microsoft Search Server 2008 - Technical Overview
 
Mike Taulty OData (NxtGen User Group UK)
Mike Taulty OData (NxtGen User Group UK)Mike Taulty OData (NxtGen User Group UK)
Mike Taulty OData (NxtGen User Group UK)
 
J2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - ComponentsJ2EE - JSP-Servlet- Container - Components
J2EE - JSP-Servlet- Container - Components
 
Spring core
Spring coreSpring core
Spring core
 
Different Types of Containers in Spring
Different Types of Containers in Spring Different Types of Containers in Spring
Different Types of Containers in Spring
 
Spring & hibernate
Spring & hibernateSpring & hibernate
Spring & hibernate
 
Maven
MavenMaven
Maven
 

Similar to .NET Core, ASP.NET Core Course, Session 18

Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4Umar Ali
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Bluegrass Digital
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Coremohamed elshafey
 
Murach: An introduction to web programming with ASP.NET Core MVC
Murach: An introduction to web programming with ASP.NET Core MVCMurach: An introduction to web programming with ASP.NET Core MVC
Murach: An introduction to web programming with ASP.NET Core MVCMahmoudOHassouna
 
Top 10 - ASP.NET Interview Questions And Answers 2023.pdf
Top 10 -  ASP.NET Interview Questions And Answers 2023.pdfTop 10 -  ASP.NET Interview Questions And Answers 2023.pdf
Top 10 - ASP.NET Interview Questions And Answers 2023.pdfRuddarpratap
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET PresentationRasel Khan
 
Announcing asp.net core updates in .net 5 preview 8
Announcing asp.net core updates in .net 5 preview 8Announcing asp.net core updates in .net 5 preview 8
Announcing asp.net core updates in .net 5 preview 8Concetto Labs
 
All the amazing features of asp.net core
All the amazing features of asp.net coreAll the amazing features of asp.net core
All the amazing features of asp.net coreGrayCell Technologies
 
Asp. net core 3.0 build modern web and cloud applications (top 13 features +...
Asp. net core 3.0  build modern web and cloud applications (top 13 features +...Asp. net core 3.0  build modern web and cloud applications (top 13 features +...
Asp. net core 3.0 build modern web and cloud applications (top 13 features +...Katy Slemon
 
Windows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressWindows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressGeorge Kanellopoulos
 
ASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesEamonn Boyle
 
MVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelMVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelAlex Thissen
 
New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0Dima Maleev
 
Web Development with ASP.NET: Taking Control of the Digital World
Web Development with ASP.NET: Taking Control  of the Digital WorldWeb Development with ASP.NET: Taking Control  of the Digital World
Web Development with ASP.NET: Taking Control of the Digital Worldcompany
 
Modernizing existing .NET applications with Windows Containers and Azure cloud
Modernizing existing .NET applications with Windows Containers and Azure cloudModernizing existing .NET applications with Windows Containers and Azure cloud
Modernizing existing .NET applications with Windows Containers and Azure cloudMicrosoft Tech Community
 

Similar to .NET Core, ASP.NET Core Course, Session 18 (20)

Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4Difference between asp.net mvc 3 and asp.net mvc 4
Difference between asp.net mvc 3 and asp.net mvc 4
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
 
Beginners introduction to asp.net
Beginners introduction to asp.netBeginners introduction to asp.net
Beginners introduction to asp.net
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Core
 
Murach: An introduction to web programming with ASP.NET Core MVC
Murach: An introduction to web programming with ASP.NET Core MVCMurach: An introduction to web programming with ASP.NET Core MVC
Murach: An introduction to web programming with ASP.NET Core MVC
 
Top 10 - ASP.NET Interview Questions And Answers 2023.pdf
Top 10 -  ASP.NET Interview Questions And Answers 2023.pdfTop 10 -  ASP.NET Interview Questions And Answers 2023.pdf
Top 10 - ASP.NET Interview Questions And Answers 2023.pdf
 
ASP.NET Presentation
ASP.NET PresentationASP.NET Presentation
ASP.NET Presentation
 
Announcing asp.net core updates in .net 5 preview 8
Announcing asp.net core updates in .net 5 preview 8Announcing asp.net core updates in .net 5 preview 8
Announcing asp.net core updates in .net 5 preview 8
 
Asp.net core tutorial
Asp.net core tutorialAsp.net core tutorial
Asp.net core tutorial
 
sveltekit-en.pdf
sveltekit-en.pdfsveltekit-en.pdf
sveltekit-en.pdf
 
All the amazing features of asp.net core
All the amazing features of asp.net coreAll the amazing features of asp.net core
All the amazing features of asp.net core
 
Asp. net core 3.0 build modern web and cloud applications (top 13 features +...
Asp. net core 3.0  build modern web and cloud applications (top 13 features +...Asp. net core 3.0  build modern web and cloud applications (top 13 features +...
Asp. net core 3.0 build modern web and cloud applications (top 13 features +...
 
Windows Azure & How to Deploy Wordress
Windows Azure & How to Deploy WordressWindows Azure & How to Deploy Wordress
Windows Azure & How to Deploy Wordress
 
ASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesASP .Net Core SPA Templates
ASP .Net Core SPA Templates
 
MVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelMVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming model
 
Mvc
MvcMvc
Mvc
 
New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0New Features Of ASP.Net 4 0
New Features Of ASP.Net 4 0
 
Web Development with ASP.NET: Taking Control of the Digital World
Web Development with ASP.NET: Taking Control  of the Digital WorldWeb Development with ASP.NET: Taking Control  of the Digital World
Web Development with ASP.NET: Taking Control of the Digital World
 
Modernizing existing .NET applications with Windows Containers and Azure cloud
Modernizing existing .NET applications with Windows Containers and Azure cloudModernizing existing .NET applications with Windows Containers and Azure cloud
Modernizing existing .NET applications with Windows Containers and Azure cloud
 
Express node js
Express node jsExpress node js
Express node js
 

More from aminmesbahi

How to choose appropriate technology for product development - Persian Version
How to choose appropriate technology for product development - Persian VersionHow to choose appropriate technology for product development - Persian Version
How to choose appropriate technology for product development - Persian Versionaminmesbahi
 
How to choose appropriate technology for product development
How to choose appropriate technology for product developmentHow to choose appropriate technology for product development
How to choose appropriate technology for product developmentaminmesbahi
 
Python + Machine Learning Course, Session 2
Python + Machine Learning Course, Session 2Python + Machine Learning Course, Session 2
Python + Machine Learning Course, Session 2aminmesbahi
 
Python + Machine Learning Course, Session 1
Python + Machine Learning Course, Session 1Python + Machine Learning Course, Session 1
Python + Machine Learning Course, Session 1aminmesbahi
 
.NET Core, ASP.NET Core Course, Session 5
.NET Core, ASP.NET Core Course, Session 5.NET Core, ASP.NET Core Course, Session 5
.NET Core, ASP.NET Core Course, Session 5aminmesbahi
 
.NET Core, ASP.NET Core Course, Session 4
.NET Core, ASP.NET Core Course, Session 4.NET Core, ASP.NET Core Course, Session 4
.NET Core, ASP.NET Core Course, Session 4aminmesbahi
 
A comparative study of process templates in team
A comparative study of process templates in teamA comparative study of process templates in team
A comparative study of process templates in teamaminmesbahi
 
SQL server 2016 New Features
SQL server 2016 New FeaturesSQL server 2016 New Features
SQL server 2016 New Featuresaminmesbahi
 

More from aminmesbahi (8)

How to choose appropriate technology for product development - Persian Version
How to choose appropriate technology for product development - Persian VersionHow to choose appropriate technology for product development - Persian Version
How to choose appropriate technology for product development - Persian Version
 
How to choose appropriate technology for product development
How to choose appropriate technology for product developmentHow to choose appropriate technology for product development
How to choose appropriate technology for product development
 
Python + Machine Learning Course, Session 2
Python + Machine Learning Course, Session 2Python + Machine Learning Course, Session 2
Python + Machine Learning Course, Session 2
 
Python + Machine Learning Course, Session 1
Python + Machine Learning Course, Session 1Python + Machine Learning Course, Session 1
Python + Machine Learning Course, Session 1
 
.NET Core, ASP.NET Core Course, Session 5
.NET Core, ASP.NET Core Course, Session 5.NET Core, ASP.NET Core Course, Session 5
.NET Core, ASP.NET Core Course, Session 5
 
.NET Core, ASP.NET Core Course, Session 4
.NET Core, ASP.NET Core Course, Session 4.NET Core, ASP.NET Core Course, Session 4
.NET Core, ASP.NET Core Course, Session 4
 
A comparative study of process templates in team
A comparative study of process templates in teamA comparative study of process templates in team
A comparative study of process templates in team
 
SQL server 2016 New Features
SQL server 2016 New FeaturesSQL server 2016 New Features
SQL server 2016 New Features
 

Recently uploaded

Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 

Recently uploaded (20)

Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 

.NET Core, ASP.NET Core Course, Session 18

  • 1. .NET Core + ASP.NET Core Training Course Session 18
  • 2. .NET Core What we learned? Session 6 ~ 16 Overview • ASP.NET Core Basics • Middleware, Controllers, Action Filters and Routing • Models • Views • Entity Framework Core
  • 3. .NET Core What we’ll learn today? Session 16 Agenda • Welcome to ASP.NET Core 1.1
  • 4. .NET Core Changelog ASP.NET Core 1.1 Performance • ASP.NET Core running on Linux is approximately 760 times faster than it was one year ago (TechEmpower benchmarks)
  • 5. .NET Core Changelog ASP.NET Core 1.1 What’s New • Improved and cross-platform compatible site hosting capabilities when using a host other than Windows Internet Information Server (IIS). • Support for developing with native Windows capabilities • Compatibility, portability and performance of middleware and other MVC features throughout the UI framework • Improved deployment and management experience of ASP.NET Core applications on Microsoft Azure. We think these improvements help make ASP.NET Core the best choice for developing an application for the cloud.
  • 6. .NET Core Changelog ASP.NET Core 1.1 What’s New • Improved and cross-platform compatible site hosting capabilities when using a host other than Windows Internet Information Server (IIS). • Support for developing with native Windows capabilities • Compatibility, portability and performance of middleware and other MVC features throughout the UI framework • Improved deployment and management experience of ASP.NET Core applications on Microsoft Azure. We think these improvements help make ASP.NET Core the best choice for developing an application for the cloud.
  • 7. .NET Core URL Rewriting Middleware ASP.NET Core 1.1 URL rewriting functionality to ASP.NET Core through a middleware component that can be configured using IIS standard XML formatted rules, Apache Mod_Rewrite syntax, or some simple C# methods coded into your application. When you want to run your ASP.NET Core application outside of IIS, we want to enable those same rich URL rewriting capabilities regardless of the web host you are using. If you are using containers, Apache, or nginx you will be able to have ASP.NET Core manage this capability for you with a uniform syntax that you are familiar with.
  • 8. .NET Core URL Rewriting Middleware ASP.NET Core 1.1 URL Rewriting allows mapping a public URL space, designed for consumption of your clients, to whatever representation the downstream components of your middleware pipeline require as well as redirecting clients to different URLs based on a pattern. For example, you could ensure a canonical hostname by rewriting any requests to http://example.com to instead be http://www.example.com for everything after the re-write rules have run. Another example is to redirect all requests to http://example.com to https://example.com. You can even configure URL rewrite such that both rules are applied and all requests to example.com are always redirected to SSL and rewritten to www.
  • 9. .NET Core URL Rewriting Middleware ASP.NET Core 1.1 • Url Redirect sends an HTTP 301 Moved Permanently status code to the client with the new address • Url Rewrite gives a different URL to the next steps in the HTTP pipeline, tricking it into thinking a different address was requested.
  • 10. .NET Core Response Caching Middleware ASP.NET Core 1.1 Response Caching similar to the OutputCache capabilities of previous ASP.NET releases can now be activated in your application by adding the Microsoft.AspNetCore.ResponseCaching and the Microsoft.Extensions.Caching.Memory packages to your application. You can add this middleware to your application in the Startup.ConfigureServices method and configure the response caching from the Startup.Configure method. You can now add GZipCompression to the ASP.NET HTTP Pipeline if you would like ASP.NET to do your compression instead of a front-end web server. IIS would have normally handled this for you, but in environments where your host does not provide compression capabilities, ASP.NET Core can do this for you.
  • 11. .NET Core Response Caching Middleware ASP.NET Core 1.1 Microsoft.AspNetCore.ResponseCompression package
  • 12. .NET Core WebListener Server for Windows ASP.NET Core 1.1 WebListener is a server that runs directly on top of the Windows Http Server API. WebListener gives you the option to take advantage of Windows specific features, like • support for Windows authentication • port sharing • HTTPS with SNI • HTTP/2 over TLS (Windows 10) • direct file transmission • response caching WebSockets (Windows 8) This may be advantageous for you if you want to bundle an ASP.NET Core microservice in a Windows container that takes advantage of these Windows features.
  • 13. .NET Core WebListener Server for Windows ASP.NET Core 1.1 On Windows you can use this server instead of Kestrel by referencing the Microsoft.AspNetCore.Server.WebListener package instead of the Kestrel package and configuring your WebHostBuilder to use Weblistener instead of Kestrel:
  • 14. .NET Core View Components as Tag Helpers ASP.NET Core 1.1 ViewComponents are an ASP.NET Core display concept that provides for a razor view that is triggered from a server-side class that inherits from the ViewComponent base class. You can now invoke from your views using Tag Helper syntax and get all the benefits of IntelliSense and Tag Helper tooling in Visual Studio. Previously, to invoke a View Component from a view you would use the Component.InvokeAsync method and pass in any View Component arguments using an anonymous object: @await Component.InvokeAsync("Copyright", new { website = "example.com", year = 2016 })
  • 15. .NET Core View Components as Tag Helpers ASP.NET Core 1.1 With the Component.Invoke syntax, there is no obvious way to add CSS classes or get tooltips to assist in configuring the component like we have with the TagHelper feature. Finally, this keeps us in “HTML Editing” mode and allows a developer to avoid shifting into C# in order to reference a ViewComponent they want to add to a page. To enable invoking your View Components as Tag Helpers simply add your View Components as Tag Helpers using the @addTagHelpers directive: @addTagHelper "*, WebApplication1"
  • 16. .NET Core Middleware as MVC filters ASP.NET Core 1.1 Middleware typically sits in the global request handling pipeline. You can now apply middleware as an MVC resource filter using the new MiddlewareFilterAttribute. For example, you could apply response compression or caching to a specific action, or you might use a route value based request culture provider to establish the current culture for the request using the localization middleware.
  • 17. .NET Core Middleware as MVC filters ASP.NET Core 1.1
  • 18. .NET Core Middleware as MVC filters ASP.NET Core 1.1
  • 19. .NET Core Cookie-based TempData provider ASP.NET Core 1.1 To use the cookie-based TempData provider you register the CookieTempDataProvider service in your ConfigureServices method after adding the MVC services as follows:
  • 20. .NET Core View compilation ASP.NET Core 1.1 The Razor syntax for views provides a flexible development experience where compilation of the views happens automatically at runtime when the view is executed. However, there are some scenarios where you do not want the Razor syntax compiled at runtime. You can now compile the Razor views that your application references and deploy them with your application.
  • 21. .NET Core View compilation ASP.NET Core 1.1 To enable view compilation as part of publishing your application, 1. Add a reference to “Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Design” under the “dependencies” section. 2. Add a reference to “Microsoft.AspNetCore.Mvc.Razor.ViewCompilation.Tools” under the tools section 3. Add a postpublish script to invoke view compiler:
  • 22. .NET Core Azure App Service logging provider ASP.NET Core 1.1 The Microsoft.AspNetCore.AzureAppServicesIntegration package allows your application to take advantage of App Service specific logging and diagnostics. Any log messages that are written using the ILogger/ILoggerFactory abstractions will go to the locations configured in the Diagnostics Logs section of your App Service configuration in the portal (see screenshot). We highly recommend using this logging provider when deploying an application to Azure App Service. Prior to this feature, it was very difficult to capture log files without a third party provider or hosted service.
  • 23. .NET Core Azure Key Vault configuration provider ASP.NET Core 1.1 Azure Key Vault is a service that can be used to store secret cryptographic keys and other secrets in a security hardened container on Azure. You can set up your own Key Vault by following the Getting Started docs. The Microsoft.Extensions.Configuration.AzureKeyVault package then provides a configuration provider for your Azure Key Vault. This package allows you to retrieve configuration from Key Vault secrets on application start and hold it in memory, using the normal ASP.NET Core configuration abstractions to access the configuration data.
  • 24. .NET Core Redis and Azure Storage Data Protection Key Repositories ASP.NET Core 1.1 The Microsoft.AspNetCore.DataProtection.AzureStorage and Microsoft.AspNetCore.DataProtection.Redis packages allow storing your Data Protection keys in Azure Storage or Redis respectively. This allows keys to be shared across several instances of a web application so that you can share an authentication cookie, or CSRF protection across many load balanced servers running your ASP.NET Core application. As data protection is used behind the scenes for a few things in MVC it’s extremely probable once you start scaling out you will need to share the keyring. Your options for sharing keys before these two packages would be to use a network share with a file based key repository.
  • 25. .NET Core Redis and Azure Storage Data Protection Key Repositories ASP.NET Core 1.1 The Microsoft.AspNetCore.DataProtection.AzureStorage and Microsoft.AspNetCore.DataProtection.Redis packages allow storing your Data Protection keys in Azure Storage or Redis respectively. This allows keys to be shared across several instances of a web application so that you can share an authentication cookie, or CSRF protection across many load balanced servers running your ASP.NET Core application. As data protection is used behind the scenes for a few things in MVC it’s extremely probable once you start scaling out you will need to share the keyring. Your options for sharing keys before these two packages would be to use a network share with a file based key repository.