This repository was archived by the owner on Jun 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-15
lines changed Expand file tree Collapse file tree 1 file changed +14
-15
lines changed Original file line number Diff line number Diff line change 1
- using System ;
2
- using System . Linq ;
1
+ using System ;
3
2
4
- namespace ClickHouse . Client ;
5
-
6
- internal class FeatureSwitch
3
+ namespace ClickHouse . Client
7
4
{
8
- private const string Prefix = "ClickHouse.Client." ;
5
+ internal class FeatureSwitch
6
+ {
7
+ private const string Prefix = "ClickHouse.Client." ;
9
8
10
- // Field names are used as switch
11
- public static readonly bool DisableReplacingParameters ;
9
+ public static readonly bool DisableReplacingParameters ;
12
10
13
- static FeatureSwitch ( )
14
- {
15
- var fields = typeof ( FeatureSwitch ) . GetFields ( ) . Where ( f => f . FieldType == typeof ( bool ) ) ;
16
- foreach ( var field in fields )
11
+ static FeatureSwitch ( )
12
+ {
13
+ DisableReplacingParameters = GetSwitchValue ( nameof ( DisableReplacingParameters ) ) ;
14
+ }
15
+
16
+ private static bool GetSwitchValue ( string switchName )
17
17
{
18
- var switchName = Prefix + field . Name ;
19
- AppContext . TryGetSwitch ( switchName , out bool switchValue ) ;
20
- field . SetValue ( null , switchValue ) ;
18
+ AppContext . TryGetSwitch ( Prefix + switchName , out bool switchValue ) ;
19
+ return switchValue ;
21
20
}
22
21
}
23
22
}
You can’t perform that action at this time.
0 commit comments