In my query i need to return IEnumerable
but i dont know if this action make the query to execute again?
var data = Repository<Person>.Find().AsEnumerable();
Find()
returns IQueryable
and because IQueryable
inherits IEnumerable
. I doubt if AsEnumerable
make the repetitive execution.
I know that
var data = Repository<Person>.Find().ToList()
executes the query two times. One for Find()
and second for Tolist()
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…