returning strings from first/singleordefault queries
add null returns for reference types for first/singleordefault queries
It does this by modifying the ObjectExtensions to use a switch statement that provides matches for null values and strings before the existing behaviors. Null values use an empty array to convert to the DataTable, while strings use the existing behavior for non-IEnumerables. Since this check needs to happen before the test for the result being IEnumerable, there's a slight duplication that has been documented.
This pull request adds support for:
It does this by modifying the ObjectExtensions to use a switch statement that provides matches for null values and strings before the existing behaviors. Null values use an empty array to convert to the DataTable, while strings use the existing behavior for non-IEnumerables. Since this check needs to happen before the test for the result being IEnumerable, there's a slight duplication that has been documented.