Sunday, October 14, 2018

Difference Between First() And FirstOrDefault()

The major difference between First and FirstOrDefault is that First() will throw an exception if there is no result data for the supplied criteria whereas FirstOrDefault() returns a default value (null) if there is no result data.

source https://www.c-sharpcorner.com/Blogs/difference-between-first-and-firstordefault

No comments:

Post a Comment