I'm getting data from an external API and the code looks like this (this part is fine):
@code {
IEnumerable<IDictionary<string, object>> data;
int count;
bool isLoading;
async Task LoadData(LoadDataArgs args)
{
isLoading = true;
var uri = new Uri("https://services.radzen.com/odata/Northwind/Employees")
.GetODataUri(filter: args.Filter, top: args.Top, skip: args.Skip, orderby: args.OrderBy, count: true);
var response = await new HttpClient().SendAsync(new HttpRequestMessage(HttpMethod.Get, uri));
var result = await response.ReadAsync<ODataServiceResult<IDictionary<string, object>>>();
data = result.Value.AsODataEnumerable();
count = result.Count;
isLoading = false;
}
}
On the dropdown menu I want to display the EmployeeID, but cannot access it (the Data="@data.Employee.ID" is incorrect and not sure what to put in there to make it work).
<RadzenDropDown Data="@data.EmployeeID" TextProperty="EmployeeID" ValueProperty="EmployeeID" Name="Dropdown1" TValue="string">
</RadzenDropDown>
Thanks!
The problem is that the Data Property is:
It should be:
So then you can acess to Employee class properties.