I need to migrate an MVC project to .net Core, I know it has System.Web removed from ASP.net Core. I need to convert HttpContext.Current.Session ["name"]! = Null at asp.net core. I added: using Microsoft.AspNetCore.Http but I have an error.
Use like this:
HttpContext.Session.SetString("priceModel", JsonConvert.SerializeObject(customobject));
var priceDetails = HttpContext.Session.GetString("priceModel");
Make sure below points in startup class:
AddSession in ConfigureServices method
services.AddSession();
Usesession in configure method:
app.UseSession();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With