I\'m getting an exception whenever I fetch like this
Feature f = o.Features.SingleOrDefault(e => e.LinkName == PageLink);
because this can r
If you only want the first element, use FirstOrDefault
instead.
Basically, here are the options in terms of valid results (i.e. where you don't want to throw) and what to use:
Single
SingleOrDefault
First
FirstOrDefault
(ElementAt
and ElementAtOrDefault
, Last
and LastOrDefault
are also available.)