Class DelegateUtilityExtensions
This is an extension implementation of the most common methods on the DelegateUtility class.
Inheritance
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public static class DelegateUtilityExtensions
Methods
| Improve this DocConfigureOptions<TOptions>(Action<TOptions>)
Provides a generic way to support the options pattern which enables using custom options classes to represent a group of related settings.
Declaration
public static TOptions ConfigureOptions<TOptions>(this Action<TOptions> setup)
Parameters
Type | Name | Description |
---|---|---|
System.Action<TOptions> | setup | The delegate that will configure the public read-write properties of |
Returns
Type | Description |
---|---|
TOptions | A default constructed instance of |
Type Parameters
Name | Description |
---|---|
TOptions | The type of the custom options class. |
DynamicWrap<TResult>(TResult)
Provides a way to dynamically wrap a return value (typically from a property or field) inside an anonymous method.
Declaration
public static Func<TResult> DynamicWrap<TResult>(this TResult output)
Parameters
Type | Name | Description |
---|---|---|
TResult | output | The value to dynamically wrap as a return value (typically from a property of field) inside an anonymous method. |
Returns
Type | Description |
---|---|
System.Func<TResult> | An anonymous method that returns the value of |
Type Parameters
Name | Description |
---|---|
TResult | The type of the return value of |
Wrap<TResult>(TResult)
Provides an easy and reflection less way to get a value from a property that is delegate compatible (such as System.Func<TResult> and the likes thereof).
Declaration
public static TResult Wrap<TResult>(this TResult output)
Parameters
Type | Name | Description |
---|---|---|
TResult | output | The return value of a member to be routed as output through this Wrap{TResult} method. |
Returns
Type | Description |
---|---|
TResult | The value from |
Type Parameters
Name | Description |
---|---|
TResult | The type of the return value of |