Summary
Returns the single element of the sequence, or
default if the sequence is empty or contains more than one element.- Assembly
- GitVersion
.Core .dll - Namespace
- GitVersion
.Extensions - Containing Type
- EnumerableExtensions
Syntax
public static T OnlyOrDefault<T>(this IEnumerable<T> source)
Attributes
| Type | Description |
|---|---|
| Nullable |
Type Parameters
| Name | Description |
|---|---|
| T |
Parameters
| Name | Type | Description |
|---|---|---|
| source | IEnumerable |
Return Value
| Type | Description |
|---|---|
| T |