[
https://issues.apache.org/jira/browse/IGNITE-18059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17627612#comment-17627612
]
Pavel Tupitsyn commented on IGNITE-18059:
-----------------------------------------
Merged to main: 9a0f86cad7c9a3bc6f0cf13c79afc29964fa631d
> .NET: Thin 3.0: Error codes should be constants
> -----------------------------------------------
>
> Key: IGNITE-18059
> URL: https://issues.apache.org/jira/browse/IGNITE-18059
> Project: Ignite
> Issue Type: Improvement
> Components: platforms, thin client
> Reporter: Pavel Tupitsyn
> Assignee: Pavel Tupitsyn
> Priority: Major
> Labels: .NET, ignite-3
> Fix For: 3.0.0-beta2
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Currently, error codes in generated *ErrorGroups* class are *static readonly
> int*, because we calculate them at runtime with *GetFullCode*.
> However, this prevents pattern matching. The following does not work:
> {code}
> if (e is IgniteClientConnectionException { Code:
> ErrorGroups.Client.ClusterIdMismatch })
> {
> ...
> }
> {code}
> Compiler error: *[CS0150] A constant value is expected*.
> Since we use code generation, it is easy to compute error codes at compile
> time and use constants to make things nicer for the users.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)