I am not sure if you even need this property at all then.
You can simply query the DB directly during DataPortal_Update/Insert method.
Sergey Barskiy
Principal Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: Cosmin [mailto:cslanet@lhotka.net]
Sent: Thursday, November 20, 2008 12:02 PM
To: Sergey Barskiy
Subject: [CSLA .NET] Lazy Loading question
Hi,
What happpens if I create a lazy property(ReadOnlyBase) and don't use it on the
clientat all but use it on the server on update or insert?
Say we have a Customer object and a PriceList(lazy) associated with it. On the
update of the customer I need some data from the PriceList. What happens if I
touch the PriceList property on the server side?
I know, the best way to know is to try it but don't have time right now and I
also need to know if it is ok or my design is not right.
I think this works just fine.
In your Customer example, the object returned from the server after an update/insert will have a populated PriceList that will be returned with the object.
DataPortal.Fetch on the "server" side would typically use the "local" data portal. You can freely use your CSLA objects on the server, but any fetching/saving occurs on the same machine. CSLA calls on the server works like a single machine deployment with all your execution logic running on the same machine.
That being said, I believe it is possible to chain data portals from one server to another, but that probably isn't typical.
Copyright (c) Marimer LLC