I have a user model for a C# web app that I populate in a controller with various properties like username etc.
I'd just like to know if there is a place where I can instantiate this class once and then reuse it in multiple controllers as currently I have it setup so that every single controller creates a new instance of User adds the relevant data to it and passes it to it's view but this doesn't seem efficient!
BaseControllerand put you common stuff in its constructor and have all you controllers inherit fromBaseControllerMemoryCachewhich is fine for certain global data that wont ever change but its not suitable for storing user data - for that you need sessionBaseControlleryou could have a (say) UserData property which gets the object from Session (or if it does not exist, gets it from the database)