My "QueryAsync" never gets to the "return" statement

Ed Hansen 26 Reputation points
2020-12-10T20:21:27.663+00:00

I'm using server Blazor with Dapper, using Alan Simpsons YouTube Tutorial.

The PlantList.razor Page triggers the generation of a plant list in the PlantService.cs file. The query executes the stored procedure but never gets to the "return plants;" statement. Instead execution goes back to the PlantList.razor Page at the "foreach (statement 18) and fails because "plants" in null. I've also tried using a query - not a stored procedure - same result. Any suggestions? Thanks.

47091-image.png

47082-image.png

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,596 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jaliya Udagedara 2,821 Reputation points MVP
    2020-12-10T20:36:45.273+00:00

    You can do something like this,

    @if (plants == null)
    {
        <p>Loading...</p>
    }
    else
    {
        <table>
               // your code
        </table>
    }
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.