开发者

Recommended way to access Session object from views

开发者 https://www.devze.com 2023-01-27 21:05 出处:网络
I am storing \"POCO\" objects in the Session object. I need to access them from my view开发者_如何学运维s -strongly typed to use Intellisense.

I am storing "POCO" objects in the Session object. I need to access them from my view开发者_如何学运维s -strongly typed to use Intellisense.

I think my options are 1. ViewModel and 2. Singleton class. Do I have more options? How should I decide? Thank you.


Do this type of work in the controller. Grab whatever you need from the session and then convert to ViewModels.

0

精彩评论

暂无评论...
验证码 换一张
取 消