owin middleware in vnext
Post on 06-Aug-2015
101 Views
Preview:
TRANSCRIPT
Custom Middlewarewith
OWIN & Katana (in ASP.NET vNext)
ONDREJ BALAS
@ONDREJBALAS WWW.ONDREJBALAS.COM
ONDREJ@ONDREJBALAS.COM
ONDREJ BALAS Microsoft MVP in C#
Writer for Visual Studio Magazine
Owner of UseTech Design
Building software that drives business
Serial Entrepreneur
WWW.ONDREJBALAS.COM
ONDREJ@ONDREJBALAS.COM @ONDREJBALAS
<configuration> <system.web> <httpModules> <add name="HelloWorldModule" type="HelloWorldModule"/> </httpModules> </system.web> </configuration>
Implementing IHttpModule
Middleware is for cross-cutting concerns
Logging
Access Control (Authentication & Authorization)
Routing
Serving Special Content
Any other time you want to do some THING between receiving a request and returning a response, even if that THING is preventing something else from happening.
Middleware CodeVISUAL STUDIO 2015 RC
PROJECT TYPE: ASP.NET WEB APPLICATION
TEMPLATE: WEB SITE (ASP.NET 5 PREVIEW TEMPLATE)
AUTHENTICATION: NO AUTHENTICATION
// Do something before
await _next(context);
// Do something after
Middleware
// Do something before
await _next(context);
// Do something after
// Do something before
await _next(context);
// Do something after
Middleware
// Do something before
await _next(context);
// Do something after
// Do something before
await _next(context);
// Do something after
// Do something before
await _next(context);
// Do something after
Middleware
// Do something before
await _next(context);
// Do something after
// Do something before
await _next(context);
// Do something after
String Appender Static File MVC
// Do something before
await _next(context);
// Do something after
Middleware
// Do something before
await _next(context);
// Do something after
// Do something before
await _next(context);
// Do something after
String Appender Static File MVC
Middleware CodeVISUAL STUDIO 2015 RC
PROJECT TYPE: ASP.NET WEB APPLICATION
TEMPLATE: WEB SITE (ASP.NET 5 PREVIEW TEMPLATE)
AUTHENTICATION: NO AUTHENTICATION
top related