c#


.net core equivalent for IHttpContext and HttpApplication


I have library using System.Web.HttpContext which I am migrating to .net core. Wondering what I should be using for IHttpContext and HttpApplication
You can use IHttpContextAccessor to access context. To use IHttpContextAccessor use following steps.
Register dependency in ConfigureServices method of Startup.cs
public void ConfigureServices(IServiceCollection services)
{
services.TryAddSingleton<IHttpContextAccessor, HttpContextAccessor>();
//.....
}
Inject IHttpContextAccessor wherever its required. e.g.
public void MyController(IHttpContextAccessor context)
{
var user = context.HttpContext.User
}

Related Links

Cycles or Multiple Cascasde Paths Many to Many Relationship
C# - Get html contents
How to select MySQL column headers and display them as rows in gridview columns in asp.net?
Store object's state in various stage in c#
Internal Server Error Ajax ASP.NET MVC 4.5
Xamarin Forms on iOS, while debugging elements turns to null
I can't get a thumbails by the name “x640” doesnt exit in the current context. Please everyone solve it
Going through RPG inventory, how to display items by character class type while maintaining modularity?
Serial port not reading all data
Authenticate user on Sub-domain and remain logged in on parent domain?
Save JSON object in file without rewriting the all file
c# windows phone 8 app azure table storage error
C# XAML ItemsSource BindingExpression
Is there a Webm C#/Xaml controll for UWP?
Referencing (loading) a generic type from its name in a WCF Svc markup file
It is possible to use auto-properties and have some logic in the set? [duplicate]

Categories

HOME
pact
max
gcc
mobile
jenkins-pipeline
nagios
salesforce-lightning
foreach
scapy
oms
ng2-charts
mongodb-replica-set
android-notifications
lambda-calculus
serenity-js
klipfolio
matlab-gui
datastax-enterprise
android-xml
sasl
continuous-fourier
rollupjs
openoffice-impress
akamai
loopback
keil
android-scrollview
powerbi-embedded
cocoa-scripting
anypoint-studio
pygraphviz
latency
gem-fury
ng-lightning
ssdp
collation
peerjs
risc
inner-join
amazon-fire-tv
encoder
lucee
sharpdevelop
android-vectordrawable
androiddesignsupport
codesniffer
acceleo
group
google-scholar
alarmmanager
qudpsocket
turbolinks
jspx
gdi
django-taggit
avi
audiorecord
bbedit
dday
serial-communication
transbase
tess4j
joomla3.3
jad
touch-typing
nsq
crtdbg.h
cordova-3
dojox.grid
clearcanvas
nomachine
fade
aspnet-compiler
octokit
angularjs-select2
azure-pack
panelgrid
removeall
select2-rails
ncml
jquery-ui-map
mysql-connector
scriptmanager
capitalization
httppostedfilebase
funambol
n2
javah
llblgen
s60
chars
dongle
linq-to-mysql
morfik
user-preferences
onresize
httpbrowsercapabilities
j++

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App