Hello everyone
I have a grid where I return a List that contains the data from the database and it contains the relationships, using the standard Blazor Grid the system shows the related data using the Syncfusion grid gives an error.
Json Returned
[{"modeloVeiculoId":"4e95fdbc-0695-4dcb-a029-6f8e60988ff6","fabricanteId":"94d79434-27f2-4878-885b-1243301b076c","descricao":"Meriva","fabricante":{"fabricanteId":"94d79434-27f2-4878-885b-1243301b076c","nome":"GM"},"veiculos":[]}]
Code
@page "/modelos"
@inject HttpClient http
@if (categorias == null)
{
}
else if (categorias.Length == 0)
{
Não existem categorias cadastradas...
}
else
{
@foreach (var categoria in categorias)
{
}
}
Deseja realmente excluir este item ?
@code {
ModeloVeiculo[] categorias { get; set; }
Confirma confirma;
protected override async Task OnInitializedAsync()
{
await CarregaCategorias();
}
async Task CarregaCategorias()
{
categorias = await http.GetJsonAsync("/api/modeloveiculos");
}
int codigoCategoria;
void DeletarCategoria(Guid categoriaId)
{
confirma.Exibir();
// codigoCategoria = categoriaId;
}
async Task DeletaConfirma()
{
await http.DeleteAsync($"api/categoria/{codigoCategoria}");
confirma.Ocultar();
await CarregaCategorias();
}
void CancelaConfirma()
{
confirma.Ocultar();
}
}
Attachment:
error_ae43df7f.rar