I am trying to add business rules in Monodroid project for a CSLA root class. The rule just checks if a string is valid. It seems to be working with context.AddErrorResult(PrimaryProperty,"Tax number is not correct"); and context.AddSuccessResult(false); but when i call context.AddWarningResult(PrimaryProperty, "Tax number is not correct"); my BeginSave method always throws TimedOut exception. Any suggestions ?
Which version of CSLA do you use?
Is your app N-tier or Edge application?
The most likely cause is something to do with serialization/deserialization and sometimes also WCF configuration. The Exception typically means that the client never get an answer from the server. So - assuming that it is N-tier - the next thing to check is that the message gets to the server and what happens on the server.
I am using the latest version for monodroid 4.3.13. And i still doesnt have WCF and server, this is simple class that is fetching and updating data on sqlite database and i have a simple rule that checks if a string (Tax Number) is valid (the reminder of the sum of first 8 digits devided to 11 should be equal to last digit) and I want this to be a warning. But if i call context.AddWarningResult in my business rule and after that i call BeginSave i get TimedOut exception.. it is workig with context.AddErrorResult without any errors.
Well, if you call AddErrorResult (broken rule with severity Error) you are not allowed to call BeginSave.
So I'll assume that when:
If all above is true then I would suspect some serialization/cloning issue with BrokenRulesCollection/BrokenRule.
If you call
var obj2 = obj.Clone();
on your business object (before the BeginSave call) - does the Clone run OK?
Calling var obj2 = obj.Clone(); raises the same exception...
What is the exception you get? Is it still a Timeout exception on the Clone method?
It does seem like a serialization issue with the BrokenRulesCollection.
Copyright (c) Marimer LLC