>
>Hi Linda,
>
>I did not get any other message from you besides this one, so no problem.
>
>I would prefer to not do this at the point of saving, as it just doesn't seem right to me. One of the other complications I foresee is if the save does not work, due to some business rule failing, then I'll have to track the fact that I've already copied the old entity to a new entity and not do it again. Whereas, if I do it at the point of getting the entity, I should be able to just substitute the old entity with the new one and then everything else should just work. I was looking at HookPostGetEntity(), but what I tried does not work (just switching the state to Adding).
>
>If I could trap the fact that the status is Pending, then create a new entity, copy the data from the old entity to the new one and return the new entity, that would work too, but I don't know how to do that in MM.NET.
That would be a simple way to do it Frank.
Retrieve your entity into a local entity object and check the status
PolicyEntity entityOriginal = this.GetEntity(get your initial entity)
if status = "whatever"
PolicyEntity entityNew = this.NewEntity()
entityNew.field1 = entityOriginal.field1;
etc.
If your method returns an entity object then just return the entityNew when you are done.
I would probably extract my copy stuff into a separate method in your biz obj to copy all the properties over. I am sure with some effort you could do this by looping through all the properties making it a bit more generic. Then just change the ones you need like status to what you need.
Tim
Timothy Bryan