Entity Framework Core count does not have optimal performance

前端 未结 9 1549
故里飘歌
故里飘歌 2020-12-20 12:19

I need to get the amount of records with a certain filter.

Theoretically this instruction:

_dbContext.People.Count (w => w.Type == 1);
         


        
9条回答
  •  鱼传尺愫
    2020-12-20 12:32

    Does this get what you want:

    _dbContext.People.Where(w => w.Type == 1).Count();
    

提交回复
热议问题