Answers for ".net 5 GetJsonAsync"

C#
0

.net 5 GetJsonAsync

@using System.Net.Http
@inject HttpClient Http

@code {
    private TodoItem[] todoItems;

    protected override async Task OnInitializedAsync() => 
        todoItems = await Http.GetFromJsonAsync<TodoItem[]>("api/TodoItems");
}
Posted by: Guest on November-29-2020

C# Answers by Framework

Browse Popular Code Answers by Language