Print Page | Close Window

SaveInterceptor on the client

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2012
Forum Discription: For .NET 4.5
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3881
Printed Date: 03-May-2025 at 4:33pm


Topic: SaveInterceptor on the client
Posted By: gregweb
Subject: SaveInterceptor on the client
Date Posted: 08-Jan-2013 at 1:16pm
I have a need for Interception on the client (as opposed to the server) when saving. Not to do validation, but to update fields such as ModifiedOn and ModifiedBy.

I know this could be done on the server through the SaveInterceptor, but there really is no need for it to be done on the server as the data is available on the client and no need to make the server do the work.

As far as I can tell, the EntityManager.Saving event would be the best place to do this.



Replies:
Posted By: sbelini
Date Posted: 08-Jan-2013 at 3:50pm
Hi Greg,

Your comment about the EntityManager.Saving event makes sense. Per our documentation:

"The (EntityManager.Saving) event handler can use the IdeaBlade.EntityModel.EntitySavingEventArgs.Entities list to validate, modify, delete or add entities as needed."

Where you'd be modifying the entity in this case.

If you want to relief the server of some workload, that would most certainly help. (although I wouldn't expect noticeable improvement results for this particular example)

Regards,
   Silvio.


Posted By: mgood
Date Posted: 09-Jan-2013 at 3:19am
Greg,
I believe you are using Cocktail. In Cocktail you can centrally intercept the save with an EntityManagerDelegate.

http://drc.ideablade.com/devforce-2012/bin/view/Documentation/cocktail-entitymanager-provider#HUsingtheEntityManagerDelegatetoperformcentraltasks - http://drc.ideablade.com/devforce-2012/bin/view/Documentation/cocktail-entitymanager-provider#HUsingtheEntityManagerDelegatetoperformcentraltasks


Posted By: gregweb
Date Posted: 09-Jan-2013 at 9:44am
Hi Marcel,

Yes, you are correct. Will check that out. Thanks to you both and have a Great New Year!

Greg



Print Page | Close Window