Using the async/await syntax is simpler and more readable than method chain syntax. Moreover, the current example code above doesn't handle any exceptions. If we use the async/await syntax, the exception will be thrown appropriately whenever it happens.
All of the example codes on the Ignite UI for Blazor documents should use the async/await syntax as long as there is no particular reason for avoiding it.
P.S.
You don't need to call a base method in the lifecycle methods in Razor components.
protected override void OnAfterRender(bool firstRender)
{
base.OnAfterRender(firstRender); // 👈 You don't have to do this.
We can see the example code for the
IgbAvatar
component that handles asynchronous operations with theContinueWith
method chain, as below.https://www.infragistics.com/products/ignite-ui-blazor/blazor/components/layouts/avatar
However, usual C# developers will use the
async/await
syntax in these cases, as below.Using the
async/await
syntax is simpler and more readable than method chain syntax. Moreover, the current example code above doesn't handle any exceptions. If we use theasync/await
syntax, the exception will be thrown appropriately whenever it happens.All of the example codes on the Ignite UI for Blazor documents should use the
async/await
syntax as long as there is no particular reason for avoiding it.P.S. You don't need to call a base method in the lifecycle methods in Razor components.
There is no example code that the base methods are called in Blazor lifecycle methods on the Microsoft official documentation site. https://learn.microsoft.com/en-us/aspnet/core/blazor/components/lifecycle?view=aspnetcore-7.0