Download session contents in a class

0

I have a website that works like this. It has 6 steps. Routes, Air, Hotels, Services, Summary and Payment. Every step of the way, I record in a session. After choosing each product in the session, another session is created and passed on. Well, in summary step, I have my shopping cart there. I created a class cart, with the properties referring to each relevant item in each step, type: IdRoteiro, IdAereo, ValorAereo, ValorHotel, IdHotel, DataRoteiro, DataAereo and so on. Now, how do I unpair each session item in the Cart class property? What would be the best way?

So, I still have a lot of doubts about that. I know it's primary for some, but I have doubts. As it is a step-by-step, I need in the next step to get some information, which are in a type hidden in the previous cshtml. I understood what Reyksiel said, but I still complicate myself with easy things. Missing footprint.

    
asked by anonymous 17.04.2014 / 20:04

1 answer

2

Now, how do I unload each session item in the Cart class property? What would be the best way?

Assuming you have serialized the entire class in the session this way:

Session["IdCarrinho"] = carro;

It would look something like this:

Carrinho carro = (Carrinho) Session["IdCarrinho"];
    
17.04.2014 / 20:28