Home > Net >  MVC Controller is each session to create an instance, or each request to create an instance?
MVC Controller is each session to create an instance, or each request to create an instance?

Time:09-17

I am a novice, the mechanism of MVC Controller are not familiar with,

I want in my StoreController class, to join another class member variables, don't know the life cycle of the member variables, don't have to in the Session?


The class StoreController: Controller
{
OrderInfo orderList=new OrderInfo ();
}


Instance of the Controller is the same life cycle as with the Session, the bundle together with the Session?

CodePudding user response:

Each request will create an instance
You use butt also want to come out, if an instance of each session that doing the session object
  • Related