Click or drag to resize
QueryableExCatchTSource, TException Method (IQueryableTSource, ExpressionFuncTException, IEnumerableTSource)
Creates a sequence that corresponds to the source sequence, concatenating it with the sequence resulting from calling an exception handler function 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, TException>(
	this IQueryable<TSource> source,
	Expression<Func<TException, IEnumerable<TSource>>> handler
)
where TException : Exception

Parameters

source
Type: System.LinqIQueryableTSource
Source sequence.
handler
Type: System.Linq.ExpressionsExpressionFuncTException, IEnumerableTSource
Handler to invoke when an exception of the specified type occurs.

Type Parameters

TSource
Source sequence element type.
TException
Exception type to catch.

Return Value

Type: IQueryableTSource
Source sequence, concatenated with an exception handler result sequence in case of an error.

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