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.LinqAssembly: System.Interactive.Providers (in System.Interactive.Providers.dll) Version: 1.2.0.0
Syntaxpublic 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:
IQueryableTSourceThe 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