Hi!
I have a webservice class that returns an object.
This object loads dependent objects through parameters dynamically.
A simplified version would look like this:
private EntityAssociation<Page_pages;
[XmlIgnore, SoapIgnore]
public EntityAssociation<Pagepages
{
get
{
if (_pages == null)
_pages = new EntityAssociation<Page>(this, "pages");
return _pages;
}
set { _pages = value; }
}
I'd really like to keep it like this.
But, here is my problem. all these objects load data from the
database, and there might be a few of those objects returned. Since
I'd like to keep the connection to the database open until the last
call is finished. I need some sort of event that's called after SOAP
has finished the serialization. So I can call the connection.close().
Any idea how that could work.
I'm using a workaround at the moment to avoid problems, in just
loading all dependent objects before serialization. But to increase my
flexibility I'd really like to change it.
Thanks!!