2
Reply

What is the difference between Count() and LongCount extension methods in LINQ?

Rahul  Pandey

Rahul Pandey

11y
2.5k
1
Reply

    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()

    as name suggests count is used for int32 but longcount is used for int64.