I am working on migrating my ASP.NET 4.6 framework code over to .NET Core. I'm only in the learning phase at this point. I'm new to MVC as I've always used WebForms, but I want to move away from WebForms. I'm also new to ASP.NET Core.
Basically, I have a class library that does the bulk of my work - saving me from repeating code (database, session, custom identity management) across multiple pages or even websites. I add the DLL to a project, and it's ready to go.
I'm finding that ASPNET Core doesn't quite allow this. Perhaps I'm not understanding it, or perhaps it's too early to start porting over to it.
I need to be able to access HttpContext inside my class library to manipulate things like sessions, cookies, etc. What is the easiest way to approach this? I think once I can do that, I can start making better progress.
Or, do I need to reconsider writing a class library? From my understanding, I need to write Middleware to accomplish this. But every example I could find is either incomplete or outdated already.
Any suggestions are welcome.