Another Server Side Validation Post :)

Another Server Side Validation Post :)

Old forum URL: forums.lhotka.net/forums/t/4441.aspx


stanc posted on Friday, February 29, 2008

I am having troubles figuring out the best way to handle server side validations. I have everything performing the checks against the properties like I want. My problem comes in with nUndo.

If my BO goes to the server and fails some validation, I want my object that goes back to the UI to contain the Broken Rules collection with the server side information and to maintain its EditLevel prior to calling the save.

I can return the object that was returned from the DP with the Broken Rules, but I can no longer cancel my edits to get back to the original state. Or I can return the clone, but then I would be missing the Broken Rules collection.

Any thoughts on how to proceed?

You can also check out a related post for more information on what I am trying to accomplish.

http://forums.lhotka.net/forums/thread/21497.aspx

Thanks  -stan

rsbaker0 replied on Friday, February 29, 2008

Hmmm. I'd suggest that you try to copy the BrokenRulesCollection from the object returned from the DP to the original one, but it looks on the surface like the implementation would make that difficult to do (and I'm not sure it would be advisable anyway).

The implementation seems designed so that the only way to manipulate the broken rules collection is either call CheckRules or set properties, but maybe I have overlooked something.

stanc replied on Monday, March 03, 2008

Thanks for the suggestion. It is actually something I'd already tried. The problem I had with this approach was that my properties did not know they had broken rules. I was able to get the BrokenRulesCollection into my cloned object which gave me the list of all the broken rules, but it did not tie to my properties. So, this solved 90% of my problem (and may be what I have to settle for), but if I can get it to tie to the properties that would be better.

Thanks

stanc replied on Monday, March 03, 2008

Just a small bump to see if anyone has any suggestions. The way it is looking, I may have to abandon the whole idea of server side validations.

Any input is appreciated.

Thanks

rsbaker0 replied on Friday, February 29, 2008

(duplicate removed)

Copyright (c) Marimer LLC