When i execute linq qeury like this
resource.Values.Single(value => value.Language.ID == 1051 && value.Value == "Zrušiť");
it throws InvalidOperationException with message 'Sequence contains no elements'.
But when i put expression used in Single
method into local Func variable:
Func<ResourceValue, bool> predicate =
value => value.Language.ID == 1051 && value.Value == "Zrušiť";
and call
var item = resource.Values.Single(predicate);
then 1 record is returned without error. Am i missing something or is this a bug? If you need sample app i have one for you.
asked
May 27 '11 at 06:53
Peter Šulek
492●31●32●36
Peter, let's start with the sample. You know the e-mail.
Send it to support at x-tensive.com
Got it. Will investigate on the next week.