FindSingle Method
Definition
- Namespace
- Cuemon.Extensions.Runtime
- Assemblies
- Cuemon.Extensions.Core.dll
FindSingle<T>(IDecorator<IHierarchy<T>>, Func<IHierarchy<T>, bool>)
Returns the only node that match the conditions defined by the function delegate match, or a default value if no node is found; this method throws an exception if more than one node is found.
public static IHierarchy<T> FindSingle<T>(this IDecorator<IHierarchy<T>> decorator, Func<IHierarchy<T>, bool> match)
Parameters
decoratorIDecorator<IHierarchy<T>>The decorator that wraps the IHierarchy<T> to extend.
matchFunc<IHierarchy<T>, bool>The function delegate that defines the conditions of the nodes to search for.
Returns
- IHierarchy<T>
An IHierarchy<T> node that match the conditions defined by the function delegate
match, or a default value if no node is found.
Type Parameters
TThe type of the instance that this node represents.