FirstOrDefault() = gets the first item that matches a given criteria.
SingleOrDefault() = if you specify this extension method that means you are specifically saying that there can be only one value that matches the criteria. If there are more then 1 value that matches the criteria, throw an exception.
Thanks and Regards
Source: weblogs.asp.net | |