I know it's not an issue in general, but there is no consistent sceme of naming async methods, at least none I noticed.
Also all async methods should include the Async Suffix.
Source:
https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/task-asynchronous-programming-model#BKMK_HowtoWriteanAsyncMethod
The name of an async method, by convention, ends with an "Async" suffix.
for exmaple:
https://github.com/dotnet-architecture/eShopOnWeb/blob/main/src/Web/Pages/Shared/Components/BasketComponent/Basket.cs
public async Task<IViewComponentResult> InvokeAsync() { ... }
private async Task<int> CountTotalBasketItems() { ... }
private string? GetAnnonymousIdFromCookie() { ... }
For consistency CountTotalBasketItems() should also have the Suffix like InvokeAsync()
another example:
https://github.com/dotnet-architecture/eShopOnWeb/blob/main/src/Web/Pages/Admin/EditCatalogItem.cshtml.cs
public void OnGet(CatalogItemViewModel catalogModel) { ... }
public async Task<IActionResult> OnPostAsync() { ... }
All fine up here, BUT:
https://github.com/dotnet-architecture/eShopOnWeb/blob/main/src/Web/Pages/Basket/Index.cshtml.cs
public async Task OnGet() { ... }
public async Task<IActionResult> OnPost(CatalogItemViewModel productDetails) { ... }
public async Task OnPostUpdate(IEnumerable<BasketItemViewModel> items) { ... }
I know it's not an issue in general, but there is no consistent sceme of naming async methods, at least none I noticed.
Also all async methods should include the
AsyncSuffix.Source:
https://learn.microsoft.com/en-us/dotnet/csharp/asynchronous-programming/task-asynchronous-programming-model#BKMK_HowtoWriteanAsyncMethod
for exmaple:
https://github.com/dotnet-architecture/eShopOnWeb/blob/main/src/Web/Pages/Shared/Components/BasketComponent/Basket.cs
For consistency
CountTotalBasketItems()should also have the Suffix likeInvokeAsync()another example:
https://github.com/dotnet-architecture/eShopOnWeb/blob/main/src/Web/Pages/Admin/EditCatalogItem.cshtml.cs
All fine up here, BUT:
https://github.com/dotnet-architecture/eShopOnWeb/blob/main/src/Web/Pages/Basket/Index.cshtml.cs