IEnumerableExtensionFirstOrNullHasGroupTSource Method

Gets the first VCardProperty in a collection whose Group identifier matches the specified Group identifier.

Definition

Namespace: FolkerKinzel.VCards.Extensions
Assembly: FolkerKinzel.VCards (in FolkerKinzel.VCards.dll) Version: 8.0.1+a91cc3f0fd39aeb548e16006a60ca9dd10a304a2
C#
public static TSource FirstOrNullHasGroup<TSource>(
	this IEnumerable<TSource>? values,
	string? group,
	bool skipEmptyItems = true
)
where TSource : VCardProperty

Parameters

values  IEnumerableTSource
The IEnumerableT of VCardProperty objects to search. The collection may be null, empty, or may contain null references.
group  String
The Group identifier to compare with.
skipEmptyItems  Boolean  (Optional)
Pass false to include empty items in the search. ("Empty" means that IsEmpty returns true.) null values will always be ignored.

Type Parameters

TSource
Generic type parameter that's constrained to be a class that's derived from VCardProperty.

Return Value

TSource
The first item in values whose Group identifier matches group, or null if no such item could be found.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableTSource. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

The comparison of group identifiers is case-insensitive.

See Also