I'm having a sloppy problem when it comes to fetching the data.
I have 16 thousand records in the table that are taking about 6 seconds to be fetched.
I noticed that while bringing these records this is also bringing the related records due to lazy loading . However, in this particular query there is no need to bring related records.
I think I might gain some time if I do not 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 related records, is there any way to disable lazy loading for this query in specifies?