BusinessRuleAsync ExecuteAsync method error Target object must implement IManageProperties #3236
-
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Hi @jhuerta3 - I updated your markdown to make the post more readable - view the markdown to see what I did. |
Beta Was this translation helpful? Give feedback.
-
By default an async rule doesn't populate the If you really do want to interact with On the other hand, if you just want a property value from the target object, then you should use the |
Beta Was this translation helpful? Give feedback.
-
Hello @rockfordlhotka Thank you Sir. I got it working. I changed all my methods to sync and modfied the business rule like so:
|
Beta Was this translation helpful? Give feedback.
By default an async rule doesn't populate the
Target
property. This is because an async rule is ... well ... async - and so might be running on another thread, so directly accessing theTarget
object is dangerous due to possible multithreading sync issues.If you really do want to interact with
Target
, in your rule's constructor you need to set a flag indicating that you understand the danger, and wantTarget
to be populated. By doing so, you are accepting that you understand that the object might be manipulated by multiple threads at the same time, and you understand the consequences.On the other hand, if you just want a property value from the target object, then you should use the
Inp…