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 results,
        // but in order to know the TotalCountBeforeTake I had to run the query twice.
        foreach (var result in Results)
        {
            Console.Write(result.ToString());
        }
 
                        
You want to query two things - the total number of items and a subset of items. So you need to run two queries: