Interviews2 answers
What is the difference between Count() and LongCount extension methods in LINQ?
2 Answers
1-LongCount() has a greater range than Count().
long.MinValue = -9223372036854775808
long.MaxValue = 9223372036854775807
DotNet Framework type is System.Int64
2-While count() DotNet Framework type is System.Int32
long.MinValue = -2,147,483,648
long.MaxValue = 2,147,483,647
3-So, if you want to count something which is quite big then use LongCount() extension method otherwise use Count()
Bhabani PrasadPosted May 21, 2014, 4:08 AM EDT
as name suggests count is used for int32 but longcount is used for int64.
Dharmendra SinghPosted Jun 10, 2013, 1:40 AM EDT
