-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a2f2c41
commit 6d2ba2d
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Hussy.Net; | ||
|
||
public static partial class Hussy | ||
{ | ||
/// <summary> | ||
/// Gets the first element of the source collection. | ||
/// </summary> | ||
/// <param name="source">The source collection to get the first element from.</param> | ||
/// <typeparam name="T">Specifies the type of data within the collection.</typeparam> | ||
/// <returns> | ||
/// The first element in the source collection if elements are present; | ||
/// otherwise the default value for <typeparamref name="T"/>. | ||
/// </returns> | ||
public static T? Fe<T>(this IEnumerable<T> source) => | ||
source.FirstOrDefault(); | ||
} |