Computes the sum of a sequence of long values.
- source
- A sequence of long values to calculate the sum of.
The sum of the values in the sequence.
The Queryable.Sum(IQueryable<long>) method generates a System.Linq.Expressions.MethodCallExpression that represents calling Queryable.Sum(IQueryable<long>) itself as a constructed generic method. It then passes the System.Linq.Expressions.MethodCallExpression to the IQueryProvider.Execute``1(System.Linq.Expressions.Expression) method of the System.Linq.IQueryProvider represented by the IQueryable.Provider property of the source parameter.
The query behavior that occurs as a result of executing an expression tree that represents calling Queryable.Sum(IQueryable<long>) depends on the implementation of the type of the source parameter. The expected behavior is that it returns the sum of the values in source.