<EjsGrid @ref=@grid TValue="ExpandoObject" DataSource="@Orders" AllowPaging="true" AllowResizing=true Width="100%" Height="100%">
. . . . . . . . . . .
</EjsGrid>
@code{
EjsGrid<ExpandoObject> grid { get; set; }
public List<ExpandoObject> Orders { get; set; }
protected override async Task OnInitializedAsync()
{
Orders = await OrderData.GetStudentsAsync();
}
}. . . . . . . .
public async Task<List<ExpandoObject>> GetStudentsAsync()
{
HttpClient http = new HttpClient();
var json = await http.GetStringAsync("https://localhost:44349/api/Default");
return JsonConvert.DeserializeObject<List<ExpandoObject>>(json);
} |