Home > Net >  ASP.NET the CORE in the class how to use the SESSION
ASP.NET the CORE in the class how to use the SESSION

Time:09-20

The core without HttpContext. Current

consult

CodePudding user response:

Container to register services. AddSingleton (a);

Dependency injection IHttpContextAccessor

Then use the
HttpContextAccessor. HttpContext


Container services. Even AddSession ();
Pipeline to app. UseSession ();


  • Related