It appears that .FirstOrDefault() and all similar methods for handling no
rows returned is not supported(?)
What steps will reproduce the problem?
Execute the following query:
var agency = (from a in repo.Worksheet("Accounts")
where a["Account No"].ToString() == "bogusAcct#"
select a["Agency"]).FirstOrDefault();
The column names are all correct, just the lookup value is not present in
the data. Instead of a null result (as expected), it throws either a
InvalidOperationException ("Sequence contains no elements") or a
NullReferenceException.
How do I check for an empty result set without wrapping everything in a
try/catch block?
Using latest version (downloaded today) on Windows Server 2008 in VS 2008.
Original issue reported on code.google.com by toomey.d...@gmail.com on 5 May 2010 at 3:58
Original issue reported on code.google.com by
toomey.d...@gmail.com
on 5 May 2010 at 3:58