-
Notifications
You must be signed in to change notification settings - Fork 583
Library does not follow naming convention for Async methods #200
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
Comments
I agree with you: I also believe it's important to use 'Async' suffix to clearly indicate the asynchronous nature of methods. I have forked SendGrid's repo and am working on several improvements such as ability to inject httpclient for unit testing, meaningful method names (as opposed to simply 'get', 'post', 'patch', etc.), strongly typed return values from methods, etc. In my fork I am following a naming convention where all methods have the 'Async' suffix. You can find my fork here: https://github.com/Jericho/sendgrid-csharp |
Sweet. Can you also please add CancellationToken parameters into those signatures. |
Excellent idea! I'll add CancellationToken to methods. |
done |
@roryprimrose thanks for the feedback! I'm leaving this one open for consideration. @Jericho thanks for your support! |
For reference: https://msdn.microsoft.com/en-us/library/hh873175.aspx |
I believe I've made a proper fix, if you have a moment, please take a look:
I'm planning to merge this one in today and then update the dependency here. It looks like this will be a breaking change, so I'll likely update the function naming as well. |
I might be missing something, but why is there emphasis in using dynamic objects? We lose all type safety. The v2 API that Azure still publishes an example using, was very type safe and hard to mess up. With the dynamic client, its very easy to mess up something with just a simple typo (plus there is no VS auto complete). Azure's .Net SDK has some very clean abstractions around formatting push notification json payloads with a very strong API. |
While we're on the subject of naming convention, C# uses PascalCase for property names so stuff like |
we went through a similar process recently and decided to not have an Async suffix http://docs.particular.net/nservicebus/upgrades/5to6-async-suffix your circumstance may be different. but thought u might find our logic useful |
@SimonCropp all valid reasons but IMHO being consistent with the BCL is more important |
This is resolved in this #303 |
Task based methods should use an Async suffix in their name. The current naming is misleading an implies that the code is invoked synchronously.
This would be a breaking change without overloading methods and using the ObsoleteAttribute.
The text was updated successfully, but these errors were encountered: