Hello,
This is the definition of Sum method here:
public static ***TResult*** Sum<TSource>(
this IQueryable<TSource> source,
Expression<Func<TSource, ***TResult***>> selector)

As you can see "TResult" defines the return type of the method based
on the result of the applying a lambda-expression which is TResult
too.
Now try queries like this : (the same rule applies to EF and LINQ to
SQL)
var sum = ....Where(t=>...)
.Sum(t=>(decimal?)t.Value)??0; //using nullable types

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to