I'm using Entity frameWork, I have a list of objects (data taken from the database) with Client data,
public virtual DbSet<clientes> clientes {get;set;}
public IEnumerable<clientes> FindAll()
{ db.Configuration.LazyLoadingEnabled = false;
return db.clientes.ToList();
}
Then in my form, I have a Grid
grid.datasource = clientes.ToList();
I'm calling the list on the 'On Load' form, I'm only 3 records in the database (SQLSERVER), and it takes more than 10 seconds to open the form.
In the class mapped the PK looks like this:
[Key]
public int pk_cliente {get;set;}
I was wondering if the PK mapping is wrong and it's getting lost somewhere.