I'm trying to find a decent way to pass additional information from a Silverlight client to the server during a call to SubmitChanges()
on a domain context, to be referenced during validation.
My entities have a CustomValidation
attribute that dynamically looks up what, if any, validation is required for the property from the database. Part of this lookup process requires that I specify not just what I'm validating, but additional context such as where wit开发者_C百科hin the Silverlight app I'm initiating the save, and what 'level' of validation needs to apply. The differing levels allow for validation specific to an initial, or subsequent 'save' operation, compared to a 'completion' operation whereby full validation would run.
I'm struggling to find a way to pass these additional values along with the submit request itself, and am considering stashing the information in the database before saving (tagging against the username, or somesuch), and loading it again on the server.
Surely there's a better way?
Many thanks,
Wayne
I think I have a similar scenario and what I've done was adding an Statu property to my entity. That status is set on the client so when it submits the changes to the server I can validate some of my properties depending of the value of the status.
Hope it helps.
精彩评论