PeanutButter
Loading...
Searching...
No Matches
PeanutButter.DuckTyping.Extensions.MergingExtensions Class Reference

Provides extension method for merging multiple objects behind a required interface. More...

Static Public Member Functions

static bool CanMergeAs< T > (this IEnumerable< object > sources)
 Tests if a collection of objects can back the given interface T.
static bool CanFuzzyMergeAs< T > (this IEnumerable< object > sources)
 Tests if a collection of objects can back the given interface T (fuzzy)
static T MergeAs< T > (this IEnumerable< object > sources)
 Attempts to merge a collection of objects onto one interface, first wins.
static T MergeAs< T > (this IEnumerable< object > sources, bool throwOnError)
 Attempts to merge a collection of objects onto one interface, first wins.
static T FuzzyMergeAs< T > (this IEnumerable< object > sources)
 Attempts to fuzzy-merge a collection of objects onto one interface, first wins.
static T FuzzyMergeAs< T > (this IEnumerable< object > sources, bool throwOnError)
 Attempts to fuzzy-merge a collection of objects onto one interface, first wins.

Detailed Description

Provides extension method for merging multiple objects behind a required interface.

Member Function Documentation

◆ CanFuzzyMergeAs< T >()

bool PeanutButter.DuckTyping.Extensions.MergingExtensions.CanFuzzyMergeAs< T > ( this IEnumerable< object > sources)
static

Tests if a collection of objects can back the given interface T (fuzzy)

Parameters
sources
Template Parameters
T
Returns

◆ CanMergeAs< T >()

bool PeanutButter.DuckTyping.Extensions.MergingExtensions.CanMergeAs< T > ( this IEnumerable< object > sources)
static

Tests if a collection of objects can back the given interface T.

Parameters
sources
Template Parameters
T
Returns

◆ FuzzyMergeAs< T >() [1/2]

T PeanutButter.DuckTyping.Extensions.MergingExtensions.FuzzyMergeAs< T > ( this IEnumerable< object > sources)
static

Attempts to fuzzy-merge a collection of objects onto one interface, first wins.

Parameters
sources
Template Parameters
T
Returns
Type Constraints
T :class 

◆ FuzzyMergeAs< T >() [2/2]

T PeanutButter.DuckTyping.Extensions.MergingExtensions.FuzzyMergeAs< T > ( this IEnumerable< object > sources,
bool throwOnError )
static

Attempts to fuzzy-merge a collection of objects onto one interface, first wins.

Parameters
sources
throwOnError
Template Parameters
T
Returns
Type Constraints
T :class 

◆ MergeAs< T >() [1/2]

T PeanutButter.DuckTyping.Extensions.MergingExtensions.MergeAs< T > ( this IEnumerable< object > sources)
static

Attempts to merge a collection of objects onto one interface, first wins.

Parameters
sources
Template Parameters
T
Returns
Type Constraints
T :class 

◆ MergeAs< T >() [2/2]

T PeanutButter.DuckTyping.Extensions.MergingExtensions.MergeAs< T > ( this IEnumerable< object > sources,
bool throwOnError )
static

Attempts to merge a collection of objects onto one interface, first wins.

Parameters
sources
throwOnError
Template Parameters
T
Returns
Type Constraints
T :class 

The documentation for this class was generated from the following file:
  • source/Utils/PeanutButter.DuckTyping/Extensions/MergingExtensions.cs