Click or drag to resize
QueryableExCatchTSource Method (IQueryableTSource, IEnumerableTSource)
Creates a sequence that returns the elements of the first sequence, switching to the second in case of an error.

Namespace: System.Linq
Assembly: System.Interactive.Providers (in System.Interactive.Providers.dll) Version: 1.2.0.0
Syntax
C#
public static IQueryable<TSource> Catch<TSource>(
	this IQueryable<TSource> first,
	IEnumerable<TSource> second
)

Parameters

first
Type: System.LinqIQueryableTSource
First sequence.
second
Type: System.Collections.GenericIEnumerableTSource
Second sequence, concatenated to the result in case the first sequence completes exceptionally.

Type Parameters

TSource
Source sequence element type.

Return Value

Type: IQueryableTSource
The first sequence, followed by the second sequence in case an error is produced.

Usage Note

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