How to access TempData in my own utility class? Or TempData is null in constructor
11
I use TempData in some of my Views/Actions but I'd like to extract that into some class. The problem is if I try to create my class in Controller's constructor, the TempDate there is null. Better yet, I'd like to have my class to be injectable into Controller. So I need to get access to TempData when my class is created.
So how can this TempData be constructed in a separate class?
This is ASP.NET Core 2.0 web app.