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

Sync and Async methods should have same order of parameters and proper return type #660

Open
RalfKoban opened this issue Nov 16, 2023 · 0 comments

Comments

@RalfKoban
Copy link
Owner

In case there is a synchronous method that has an asynchronous counterpart, both methods should have the same kind of parameters, in the same order.

The return value of the asynchronous method should be Task for void synchronous methods or Task<Xyz> for synchronous methods that return a Xyz.

Example:

int DoSomething(int x, int y, int z);

should have following async counterpart (if needed at all)

Task<int> DoSomethingAsync(int x, int y, int z);

In case the counterpart is e.g.

Task<int> DoSomethingAsync(int x, int z, int y);

we should report a violation because the parameters y and z are switched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Next
Development

No branches or pull requests

1 participant