locked
blazor server | Call Async function from blazor component RRS feed

  • Question

  • User2110873642 posted

    how do i call this async function properly from blazor syntax?

    Blazor component:

    <h3>LoginTest</h3>
    
    //The await operator can only be used in an async method. @if (await GetSomething()) { }

    some class library:

     public async Task<bool> GetSomething()
            {
    //I changed the function to Async task, because the code below required it. return await BlazoredSessionStorage.GetItemAsync<string>("Something"); }

    Wednesday, August 5, 2020 1:55 PM

All replies