KGy SOFT

ObjectExtensionsInT Method (T, FuncT)

KGy SOFT Core Libraries Help
Gets whether item is among the results of set.

Namespace:  KGySoft.CoreLibraries
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 5.3.0
Syntax

public static bool In<T>(
	this T item,
	params Func<T>[] set
)

Parameters

item
Type: T
The item to search for in the results of set.
set
Type: SystemFuncT
The set of delegates, whose results are checked whether they are equal to the specified item.

Type Parameters

T
The type of item and the set elements.

Return Value

Type: Boolean
 if item is among the results of set; otherwise, .

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . 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

This method works similarly to the in operator in SQL and Pascal.

This overload uses generic IEqualityComparerT implementations to compare the items for the best performance. The elements of set are evaluated only when they are actually compared so if a result is found the rest of the elements will not be evaluated.

See Also

Reference