-
Notifications
You must be signed in to change notification settings - Fork 35
M_CodeJam_Ranges_CompositeRangeExtensions_ToCompositeRangeFrom__2
Andrew Koryavchenko edited this page Jun 17, 2018
·
2 revisions
CompositeRangeExtensions.ToCompositeRangeFrom(TSource, T) Method (IEnumerable(TSource), Func(TSource, T))
Converts sequence of elements to the composite range using only From boundary. The To boundary value is taken from the next item in sequence (+∞ for the last item in sequence)
Namespace: CodeJam.Ranges
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0
C#
public static CompositeRange<T, TSource> ToCompositeRangeFrom<TSource, T>(
this IEnumerable<TSource> source,
Func<TSource, T> fromValueSelector
)
VB
<ExtensionAttribute>
Public Shared Function ToCompositeRangeFrom(Of TSource, T) (
source As IEnumerable(Of TSource),
fromValueSelector As Func(Of TSource, T)
) As CompositeRange(Of T, TSource)
F#
[<ExtensionAttribute>]
static member ToCompositeRangeFrom :
source : IEnumerable<'TSource> *
fromValueSelector : Func<'TSource, 'T> -> CompositeRange<'T, 'TSource>
- source
- Type: System.Collections.Generic.IEnumerable(TSource)
Original collection. - fromValueSelector
- Type: System.Func(TSource, T)
Callback to obtain a value for the From boundary.
- TSource
- The type of the values in original collection.
- T
- The type of the range values.
Type: CompositeRange(T, TSource)
A new composite range with keys filled from the original collection.
In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable(TSource). 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).
CompositeRangeExtensions Class
ToCompositeRangeFrom Overload
CodeJam.Ranges Namespace