Method CastTo
CastTo(ArcadeExpressionReturnType)
Cast the result of an evaluation to another type using the Arcade casting rules.
Declaration
public object CastTo(ArcadeExpressionReturnType type)
Parameters
Type | Name | Description |
---|---|---|
ArcadeExpressionReturnType | type | The type to cast to. |
Returns
Type | Description |
---|---|
System.Object | An object of the requested type or |
Remarks
Use to ensure that the final return value from a script is cast to an expected type in an Arcade-consistent manner. For more information on the casting behavior for each type, see ArcadeExpressionReturnType. Only types to which a value can be cast are available in ArcadeExpressionReturnType. Other types, such as GeoElement, should be accessed via the result property. An exception is not thrown when casting fails. Instead, a type-specific error value is returned whose value depends on the type of cast attempted.
Applies to
Platforms and versions
Target | Versions |
---|---|
.NET Standard 2.0 | 100.14 - 200.6 |
.NET | 100.14 - 200.6 |
.NET Windows | 100.14 - 200.6 |
.NET Android | 200.0 - 200.6 |
.NET iOS | 200.0 - 200.6 |
.NET Framework | 100.14 - 200.6 |
Xamarin.Android | 100.14 - 100.15 |
Xamarin.iOS | 100.14 - 100.15 |
UWP | 100.14 - 200.6 |