Windows apps
Collapse the table of content
Expand the table of content
Information
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^>^)

 

Creates a TryExpression representing a try block with any number of catch statements and neither a fault nor finally block.

Namespace:   System.Linq.Expressions
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.

No code example is currently available or this language may not be supported.

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
Return to top
Show:
© 2017 Microsoft