You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DeveloperGuide.md
+62-8Lines changed: 62 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,18 +96,18 @@ var feature = new Feature
96
96
#### ii. Regex Condition
97
97
`Regex` condition allows evaluating a regex expression against specified user claim value to enable a given feature.
98
98
99
-
Below is the serialized representation of toggle with regex condition.
99
+
Below is the serialized representation of toggle with regex condition.
100
100
```
101
101
{
102
-
"dashboard_widget":{
103
-
"toggle":{
104
-
102
+
"dashboard_widget":{
103
+
"toggle":{
104
+
105
105
"conditions":[{
106
106
"type":"Regex", -- Regex Condition
107
107
"claim":"email", -- Claim 'email' to be used for evaluation.
108
108
"expression":"*@gbk.com" -- Regex expression to be used for evaluation.
109
-
}]
110
-
}
109
+
}]
110
+
}
111
111
}
112
112
}
113
113
```
@@ -119,8 +119,8 @@ var feature = new Feature
119
119
Name ="dashboard_widget", // Feature Name
120
120
Toggle = new Toggle // Toggle definition
121
121
{
122
-
Operator = Operator.Any,
123
-
Conditions = new[]
122
+
Operator = Operator.Any,
123
+
Conditions = new[]
124
124
{
125
125
// Regex condition that evalues role of user to be administrator to enable the feature.
126
126
new RegexCondition { Claim = "role", Expression = "administrator" }
@@ -129,6 +129,60 @@ var feature = new Feature
129
129
}
130
130
```
131
131
132
+
#### iii. Relational Condition
133
+
`Relational` condition (class `RelationalCondition`) allows evaluating a user claim value against a fixed value using a relational operator. This is useful for enabling features based on user tiers, roles, or any string-comparable claim.
134
+
135
+
Supported operators (`RelationalOperator` enum):
136
+
137
+
| Operator | Description |
138
+
|---|---|
139
+
|`Equals`| Claim value equals the configured value |
140
+
|`NotEquals`| Claim value does not equal the configured value |
141
+
|`GreaterThan`| Claim value is lexicographically greater than the configured value |
142
+
|`GreaterThanOrEqual`| Claim value is lexicographically greater than or equal to the configured value |
143
+
|`LessThanOrEqual`| Claim value is lexicographically less than or equal to the configured value |
144
+
|`LessThan`| Defined in enum but **not yet implemented** — always returns `false`|
145
+
146
+
> **Note:** String comparison is ordinal (via `string.Compare`). Both the claim value and the configured value are trimmed of leading/trailing whitespace before comparison.
147
+
148
+
Below is the serialized representation of a toggle with a logical condition.
|FeatureOne |[](https://badge.fury.io/nu/FeatureOne)| Provides core functionality to implement feature toggles with `no` backend storage provider. Needs package consumer to provide `IStorageProvider` implementation. Ideal for use case that requires custom storage backend. **v5.1.0**: Security fixes, DI integration, DateRangeCondition. |
16
-
|FeatureOne.SQL|[](https://badge.fury.io/nu/FeatureOne.SQL)| Provides SQL storage provider for implementing feature toggles using `SQL` backend. **v5.1.0**: Security fixes, DI integration, enhanced configuration. |
17
-
|FeatureOne.File |[](https://badge.fury.io/nu/FeatureOne.File)| Provides File storage provider for implementing feature toggles using `File System` backend. **v5.1.0**: Security fixes, DI integration, enhanced configuration. |
14
+
|FeatureOne |[](https://badge.fury.io/nu/FeatureOne)| Provides core functionality to implement feature toggles with `no` backend storage provider. Needs package consumer to provide `IStorageProvider` implementation. Ideal for use case that requires custom storage backend. **v5.2.0**: RelationalCondition, net10.0 support, package upgrades, expanded test coverage. |
15
+
|FeatureOne.SQL|[](https://badge.fury.io/nu/FeatureOne.SQL)| Provides SQL storage provider for implementing feature toggles using `SQL` backend. **v5.2.0**: net10.0 support, package upgrades. |
| v5.1.0 | Nov 03, 2025 | Minor |**Security fixes** (ReDoS protection, secure type loading), **architectural improvements** (prefix matching, dependency injection), **new features** (DateRangeCondition, configuration validation), **DI integration**| High - maintains all existing functionality with minor security-related behavioral changes |
77
+
| v5.2.0 | Mar 18, 2026 | Minor |**New condition** (RelationalCondition with 5 relational operators), **target framework** (added net10.0, removed netstandard2.0 and net8.0), **package upgrades** (all MS packages to 10.0.5), **expanded test coverage** (98%+ line coverage) | High - fully backward compatible, additive changes only |
76
78
77
79
## Credits
78
80
Thank you for reading. Please fork, explore, contribute and report. Happy Coding !! :)
0 commit comments