Beginner |
|
Joined: Tue Sep 11, 2007 5:57 am Posts: 36
|
Hello I have defined a new class that implements IInterceptor:
I have used this to set the CreatedDate and ModifiedDate properties of the business entities. I create an object as
Address add = new Address();
add.City = "Xtz";
add.State = "Abcd";
add.Country = "Pqr";
_session.Save(add);
add.Line1 = "Street 1";
Individual ind = new Individual();
ind.ExternalID = 1234;
ind.Last = "LastName";
ind.Address1 = add;
_session.Save(ind);
When I created an object of Address and saved it the Interceptor did set the CreatedDate and ModifiedDate properties of the Address object. But this was on the server as I am using remoting, the changes are never reflected back to the object add. Then when I save Individual's object it also saves Address object add, but now as the createddate is null it updates it to null.
I can't force the user to pass the object by ref each time.
any ideas?
|
|