How to get total results count before .Take() - but when using .Take()
问题 I am using .Take() to get a fixed number of results. What is the best way to get the TotalCountBeforeTake (ie as if I didn't use the .Take())? Can I get the TotalCountBeforeTake without running the query twice? var Results = (from results in db.FindWords(term) orderby results.word select results.word).Take(100); //just to get the total record count int TotalCountBeforeTake = (from results in db.FindWords(term) select results.word).Count(); // only showing 100 out of TotalCountBeforeTake