The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
Expression::TryCatch Method (Expression^, array<CatchBlock^>^)
.NET Framework (current version)
Creates a TryExpression representing a try block with any number of catch statements and neither a fault nor finally block.
Assembly: System.Core (in System.Core.dll)
public: static TryExpression^ TryCatch( Expression^ body, ... array<CatchBlock^>^ handlers )
Parameters
- body
-
Type:
System.Linq.Expressions::Expression^
The body of the try block.
- handlers
-
Type:
array<System.Linq.Expressions::CatchBlock^>^
The array of zero or more CatchBlock expressions representing the catch statements to be associated with the try block.
The following example demonstrates how to create a TryExpression object that contains a catch statement.
Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Show: