Commit 1e81eb0
committed
Mitigated issue with non-nullable checkboxes
The `ImportOptions.DeleteUnmatched*` attributes are all `bool`, but are backed by a nullable `bool?` which defaults to `null` and inherits its value based on the `ImportOptions.Strategy` value. Unfortunately, when using the ASP.NET Core `input` tag helper with checkboxes, a hidden field is generated with the value of `false`. This results in the value of these properties _always_ being set to false, and no longer determing their value from the `ImportOptions.Strategy`. We only want that to happen when they're set to `true`. To mitigate that, we're removing the tag helper, and manually defining the `name` attribute. This introduces a risk in the case that the `enum` values change; to help avoid that potentiality in the future, we used `nameof()` on both the `enum` as well as its fields, so a compilation error will occur if those values are altered.1 parent 3eb0a30 commit 1e81eb0
1 file changed
Lines changed: 4 additions & 4 deletions
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
0 commit comments