First vs FirstOrDefault in LINQ
S.No | First | FirstOrDefault |
1 | Gives first record from the collection, if collection doesn't have any object then throws error. | FirstOrDefault extension method is used to retrieve the first element from the collection, if not then gives null |