Skip to content

M_RailwaySharp_ErrorHandling_ResultExtensions_Collect__2

Moh.Hassan edited this page Oct 10, 2019 · 1 revision

ResultExtensions.Collect(TSuccess, TMessage) Method

Collects a sequence of Results and accumulates their values. If the sequence contains an error the error will be propagated.

Namespace: RailwaySharp.ErrorHandling
Assembly: CommandLine (in CommandLine.dll) Version: 0.0.0

Syntax

C#

public static Result<IEnumerable<TSuccess>, TMessage> Collect<TSuccess, TMessage>(
	this IEnumerable<Result<TSuccess, TMessage>> values
)

VB

<ExtensionAttribute>
Public Shared Function Collect(Of TSuccess, TMessage) ( 
	values As IEnumerable(Of Result(Of TSuccess, TMessage))
) As Result(Of IEnumerable(Of TSuccess), TMessage)

C++

public:
[ExtensionAttribute]
generic<typename TSuccess, typename TMessage>
static Result<IEnumerable<TSuccess>^, TMessage>^ Collect(
	IEnumerable<Result<TSuccess, TMessage>^>^ values
)

F#

[<ExtensionAttribute>]
static member Collect : 
        values : IEnumerable<Result<'TSuccess, 'TMessage>> -> Result<IEnumerable<'TSuccess>, 'TMessage> 

Parameters

 

values
Type: System.Collections.Generic.IEnumerable(Result(TSuccess, TMessage))

Type Parameters

 

TSuccess
TMessage

Return Value

Type: Result(IEnumerable(TSuccess), TMessage)

Usage Note

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

See Also

Reference

ResultExtensions Class
RailwaySharp.ErrorHandling Namespace

Clone this wiki locally