Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Where would you put the class definition though? I am pretty new to everything still, but I am just curious about how other controllers will see the the class and know what it is. Do you just add it to the top of the controller? I was thinking on SessionStart in global.asax I would initialize things but maybe that's not the best way to do it. Commented Apr 23, 2014 at 17:48
  • @Shaun314 Ideally you'd use an IoC container to inject the object into your controller via dependency injection (see edit). Commented Apr 23, 2014 at 21:32
  • 1
    I'm storing some session information after logging in user using Identity 2. I'm not able to retrieve those information in other actions and controllers else than the first action that I redirect the user to. Any idea? Commented Jul 27, 2015 at 5:00