How to access the HttpContext in Asp.Net Core apps

preview_player
Показать описание

Accessing and working with HttpContext across different #AspNetCore apps is not complicated per se, but it can get a little bit confusing. That's why in this video we aim to clarify this topic by looking into how we can access the HttpContext in a Razor Pages app, in a regular MVC app and in a WebAPI. Last but bot least, we look into how to inject, access and use the HttpContext in Asp.Net Core middleware classes and custom components/services that are registered in the Asp.Net Core DI container.
#DotNet #DotNetCore

Chapters
1. Intro: 00:00
2. Accessing the HttpContext in Razor Pages apps: 01:34
3. Accessing the HttpContext in MVC apps: 09:39
4. Accessing the HttpContext in WebAPIs: 14:31
5. Accessing the HttpContext in custom middleware: 16:38
6. Resolving HttpContext through DI: 19:39
Рекомендации по теме
Комментарии
Автор

thank you! this helped a lot. i had been confused about this for a while

jonathanposton
Автор

Some lecture but you teach. Thank you sir!!

clintonboamah
Автор

Thankyou for this video, but what if we had a static class and wanted to access the HttpContext in it ? the DI method wont work with a static class, is there a workaround ?

RudyRdx