async
should have their names suffixed with Async
CS-R1073Task
does not follow the naming convention278 /// <param name="requestObject">The request object.</param>
279 /// <param name="token">The token.</param>
280 /// <returns>TOut.</returns>
281 public async Task<TOut> Post<TOut, TIn>(TIn requestObject, CancellationToken token)282 where TIn : Request
283 where TOut : BaseResponse
284 {
Task
does not follow the naming convention262 /// <param name="requestObject">The request object.</param>
263 /// <param name="token">The token.</param>
264 /// <returns>TOut.</returns>
265 public async Task<TOut> Get<TOut, TIn>(TIn requestObject, CancellationToken token)266 where TIn : Request
267 where TOut : BaseResponse
268 {
Task
does not follow the naming convention127 /// <returns>TOut.</returns>
128 /// <exception cref="System.Net.Http.HttpRequestException">Requested method {method} not implemented in V1</exception>
129 /// <exception cref="GuiStracini.Mandae.GoodPractices.MandaeApiException"></exception>
130 private async Task<TOut> Execute<TOut, TIn>(131 ActionMethod method,
132 TIn requestObject,
133 CancellationToken cancellationToken
Task
does not follow the naming convention 79 /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
80 /// <exception cref="System.InvalidOperationException">Cannot get the constants path</exception>
81 /// <exception cref="System.InvalidOperationException">Cannot get the constants from file {match.Value}</exception>
82 private async Task<bool> GetConstants(CancellationToken cancellationToken) 83 {
84 using (var client = new HttpClient())
85 {
Task
does not follow the naming convention270 /// <param name="requestObject">The request object.</param>
271 /// <param name="token">The token.</param>
272 /// <returns>Task<TOut>.</returns>
273 public async Task<TOut> Delete<TOut, TIn>(TIn requestObject, CancellationToken token)274 where TIn : Request
275 {
276 return await Execute<TOut, TIn>(ActionMethod.DELETE, requestObject, token)
The consensus in .NET is to have names of methods dealing with async
hronous operations suffixed with Async
. One such example is Stream.ReadAsync
from System.IO
. Doing so improves readability and provides crucial information at a glance.
public virtual System.Threading.Tasks.ValueTask<int> Read (Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.ValueTask<int> ReadAsync (Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default);