I'm testing the Blazor grid component with my entity framework classes, I don't understand why I get this error when I use the TtkTicket object. With other types of objects it looks ok. My code is this:
@page "/fetchdata"
@using Syncfusion.EJ2.Blazor.Grids
@using Microsoft.EntityFrameworkCore
@*@inject WeatherForecastService ForecastService*@
Grid test
@if (tickets == null)
{
}
else
{
}
@code {
public customerContext _context { get; set; }
public IQueryable tickets { get; set; }
protected override void OnInitialized()
{
_context = new customerContext();
try
{
tickets = _context.TtkTicket.Select(x => new TtkTicket{ TicketId = x.TicketId, TicketCode = x.TicketCode, StartDate = x.StartDate, Number = x.Number, Protocol = x.Protocol}).AsQueryable();
}
catch(Exception ex)
{
}
}
}
the error is:
System.AggregateException: One or more errors occurred. (An item with the same key has already been added. Key: BlazTempId_1215471834)
---> System.ArgumentException: An item with the same key has already been added. Key: BlazTempId_1215471834
Attched the project and erros.
Thanks
Adriano
Attachment:
BlazorApp2_a02a8ca9.zip