views:

6

answers:

0

I have a two tier architecture based website-data layer and UI layer. I have a web page, I get the id of a customer from the querystring and I build the customer object from that id. I have several tabs in my webpage, so, unless I need the data, I dont have to load the data for the grids which are in the tabs that are not clicked. That's why I use Lazy initialization for the properties of the customer which are not required on page load.

My question is, in page load when I create the customer object, if I add the customer object to session as Session[id]=customerObj, I understand that customerObj gets serialized, but does it mean that all the properties which are lazy initialized get loaded? If so, that will defeat the purpose of using lazy initialization.

I tried to look on MSDN, but could not find good explanation of how this thing is supposed to work. Any inputs is greatly appreciated. Thanks!