Page 1 of 1

Aggregate functions require lamba transform

Posted: Fri 07 Nov 2008 20:28
by bbjosh
This code fails with an ArgumentNullException 'Error the value cannot be null: Parameter name : value"

Code: Select all

var results = (from U in DataContext.USERs select U.USER_ID).Min();

This code works:

Code: Select all

var results = (from U in DataContext.USERs select U.USER_ID).Min(x => x);

Why does the aggregate function require the lambda function parameter? Both ways work OK under MS SQL Server and their LINQ driver.

Posted: Tue 11 Nov 2008 10:10
by mr_fsx
Try:
var results = DataContext.USERs.Min(user => user.USER_ID);

Posted: Fri 14 Nov 2008 12:49
by Shalex
Please try using dotConnect for Oracle 5.00 to resolve the lambda parameter issue.