CheckRulesAsync on a property #3390
Unanswered
mtavares628
asked this question in
Questions
Replies: 2 comments 5 replies
-
Hello @mtavares628
On BusinessObject I called like so.
|
Beta Was this translation helpful? Give feedback.
5 replies
-
Interesting question. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have some code from CSLA 4 that I'm converting to CSLA 6/7 so that I can use my business objects with Blazor. One of my BOs has a function on it that checks some business logic by calling BusinessRules.CheckRules on a specific property, and then looks to see if the rule name exists in the list of broken rules. This worked fine in my old ASP.NET 4.x application where everything I did was synchronous. However, now that I'm using blazor, a number of my rules are now asynchronous because they are hitting a database as part of the logic.
I had assumed that I could then make my check rules method asynchronous and just call BusinessRules.CheckRulesAsync on the same property. However, it appears there is no overload of CheckRulesAsync that takes just a property. Is this an oversight, or should I still be able to just call the sync CheckRules method, and all of my async rules will get called without an issue?
So my old code looked like this:
I was thinking I needed something like this:
However, BusinessRules.CheckRulesAsync(prop) is not a valid overload. So again, my question, will the original method still work, if I called it from the blazor client (I'm thinking not), or should there be a new overload for BusinessRules.CheckRulesAsync that will take a property?
Beta Was this translation helpful? Give feedback.
All reactions