SyntaxFix
Write A Post
Hire A Developer
Questions
From the MSDN library:
The First<TSource>(IEnumerable<TSource>) method throws an exception if source contains no elements. To instead return a default value when the source sequence is empty, use the FirstOrDefault method.
First<TSource>(IEnumerable<TSource>)
FirstOrDefault