I need to return all records that contain the informed branch using the where
clause, but the Entity Framework is returning all records ignoring what is in where
. Where am I going wrong?
public IQueryable<PessoaGenerico> GetAllPessoaGenericoByFilial(int id)
{
return DbSet
.Where(pg => pg.PessoaFilialId == id)
.AsQueryable()
.AsNoTracking();
}
Intheexample,I'mlookingforallrecordswherePessoaFilialId
isequalto31.Itshouldnotfindandreturnnull
,butit'sallfetching.