1
I have a problem of slowness at the time of bringing the data.
I have in the table 16 thousand records that are taking about 6 seconds to be brought from the bank.
I noticed that when bringing these records this being brought also the related records due to the Lazy loading. However, in this query in particular there is no need to bring the related records.
I think I could buy some time if I don’t bring these unnecessary records, follow the code:
public IList<NotaMercadoria> GetAll(long pIdCadEmpresa)
{
return entity.NotaMercadoria.Where(x => x.IDCadEmpresa == pIdCadEmpresa).ToList();
}
Since there is no need to bring the related records, is there any way to disable the Lazy loading for this query specifically?
Thank you very much, it only makes me doubt, when Lazy Loading is disabled it brings the related table but with no data in it, right? I can post an image to make it easier if I find it necessary.
– Brayan
@Brayan That’s right. The produced select will be only on the main table without any Join.
– Jéf Bueno
Ah understood, thank you very much :D
– Brayan