1) You cannot call async code from a constructor. This means we have to force it non-async by using a method like I reported, or put it in some delegate that you call later. (Ideally the rules would not be built in a constructor - but in some method. Would it be possible to create an optional 'BuildRules' method that is called on abstract validator to make this easier?)
2) When you validate, if your entire chain of code that calls the MustAsync has 'async' in the method signatures then it will work properly. Otherwise you would end up wrapping it in something like the RunSync code I attached.
3) My issue is really that I need a safe way to cal code that is already async - and I cannot do that from a constructor or must wrap it. So the call to RunSync works.
Can you point me to the code that calls these async rules?
2) When you validate, if your entire chain of code that calls the MustAsync has 'async' in the method signatures then it will work properly. Otherwise you would end up wrapping it in something like the RunSync code I attached.
3) My issue is really that I need a safe way to cal code that is already async - and I cannot do that from a constructor or must wrap it. So the call to RunSync works.
Can you point me to the code that calls these async rules?