I have an exchange rate table. I need to get current rate and previous rate and then compare results.
I can get first record using FirstOrDefault
.
When I am using ElementAtOrDefault
, this error shows "The query operator 'ElementAtOrDefault' is not supported". How can I get the second record?
Use .Skip(1) method
Take() returns null if the element is not there (so is equivalent to FirstOrDefault()).
If you'd rather an exception was thrown (cos the second element is not there) like First() then use:
You can try this: