Skip to content
Discussion options

You must be logged in to vote

The rule is probably being executed when the postback data is bound to the properties as the Project object is being created so it can be passed into the Edit method - so before any of the code in the Edit method is executed.

This occurs in Csla.Web.Mvc.Shared.CslaModelBinder:

private void BindBusinessBase(ModelBindingContext bindingContext, object result)

I don't see a way to prevent this behavior without altering CslaModelBinder - probably to globally disable the automatic running of rules, which would require that your code in the controller call CheckRules when and if you want the rules to run.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@CROprogrammer
Comment options

@rockfordlhotka
Comment options

Answer selected by CROprogrammer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants