Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept methods returning Task #3

Open
jnyrup opened this issue Nov 16, 2020 · 0 comments
Open

Accept methods returning Task #3

jnyrup opened this issue Nov 16, 2020 · 0 comments

Comments

@jnyrup
Copy link
Contributor

jnyrup commented Nov 16, 2020

Validation.Integration.WCF naturally does not support async methods decorated with [OperationContract].

This blog post describes the path to add support for async Begin/End pattern.
https://philippetruche.wordpress.com/2008/07/14/using-the-enterprise-library-validation-block-with-wcf-asynchronous-operations/

Adding support async methods returning Task or Task<T> is similar.
In addition to checking on operation.SyncMethod it should also check operation.TaskMethod.

I've been using that check for ~2 years now with net472 projects, but we want to migrate to .netstandard projects and possibly avoid maintaining my own fork of Validation.Integration.WCF.

E.g.

ValidationBehavior.HasValidationAssertions(OperationDescription operation)
{
    MethodInfo methodInfo = operation.SyncMethod ?? operation.Task;
    ...
}

public ValidationParameterInspector(OperationDescription operation, string ruleSet)
{
    MethodInfo method = operation.SyncMethod ?? operation.Task;
    ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant