first vs firstordefault in linq
- What is the difference between first and firstOrDefault in Linq?
- First() method return first element from list and if element is empty it's throw exception.
- firstOrDefault () will handle exception if list contain no element.
Comments
Post a Comment