Commit a797824
authored
docs: update dotnet workshop docs (#1289)
Signed-off-by: André Silva <[email protected]>
<!-- Please use this template for your pull request. -->
<!-- Please use the sections that you need and delete other sections -->
## This PR
This pull request updates the .NET getting started tutorial to use the
latest OpenFeature library patterns and dependency injection, improving
clarity and aligning with modern best practices. The most important
changes are grouped below:
**Dependency Injection and Library Usage Updates:**
* Added installation instructions for the `OpenFeature.Hosting` NuGet
package to support dependency injection and modern OpenFeature usage.
* Updated provider registration to use `builder.Services.AddOpenFeature`
with lambda configuration, replacing direct calls to
`Api.Instance.SetProviderAsync` for both in-memory and flagd providers.
[[1]](diffhunk://#diff-a8a7045d253a6bda66f8b29be80b12bc61d24e1b8fda49b96d4cbb117265257aL67-R84)
[[2]](diffhunk://#diff-a8a7045d253a6bda66f8b29be80b12bc61d24e1b8fda49b96d4cbb117265257aR187-R201)
**Code Modernization and API Usage:**
* Changed feature flag evaluation in route handlers to inject
`IFeatureClient` via `[FromServices]`, removing manual client
instantiation and improving testability and code clarity.
[[1]](diffhunk://#diff-a8a7045d253a6bda66f8b29be80b12bc61d24e1b8fda49b96d4cbb117265257aL105-R118)
[[2]](diffhunk://#diff-a8a7045d253a6bda66f8b29be80b12bc61d24e1b8fda49b96d4cbb117265257aL193-R213)
**Provider Integration Improvements:**
* Updated flagd provider integration to use
`OpenFeature.Contrib.Providers.Flagd.DependencyInjection` and the
`.AddFlagdProvider()` extension for simpler configuration.
[[1]](diffhunk://#diff-a8a7045d253a6bda66f8b29be80b12bc61d24e1b8fda49b96d4cbb117265257aL165-R174)
[[2]](diffhunk://#diff-a8a7045d253a6bda66f8b29be80b12bc61d24e1b8fda49b96d4cbb117265257aR187-R201)
---------
Signed-off-by: André Silva <[email protected]>1 parent cb1961c commit a797824
1 file changed
+39
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| 58 | + | |
57 | 59 | | |
| 60 | + | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| |||
64 | 67 | | |
65 | 68 | | |
66 | 69 | | |
67 | | - | |
68 | | - | |
69 | 70 | | |
70 | 71 | | |
71 | | - | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
72 | 83 | | |
73 | 84 | | |
| 85 | + | |
| 86 | + | |
74 | 87 | | |
75 | 88 | | |
76 | 89 | | |
| |||
102 | 115 | | |
103 | 116 | | |
104 | 117 | | |
105 | | - | |
| 118 | + | |
106 | 119 | | |
107 | | - | |
108 | | - | |
109 | | - | |
| 120 | + | |
110 | 121 | | |
111 | 122 | | |
112 | 123 | | |
| |||
160 | 171 | | |
161 | 172 | | |
162 | 173 | | |
| 174 | + | |
163 | 175 | | |
164 | | - | |
165 | | - | |
166 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
167 | 180 | | |
| 181 | + | |
| 182 | + | |
168 | 183 | | |
169 | 184 | | |
170 | 185 | | |
| |||
175 | 190 | | |
176 | 191 | | |
177 | 192 | | |
178 | | - | |
179 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
180 | 203 | | |
181 | | - | |
182 | | - | |
| 204 | + | |
183 | 205 | | |
| 206 | + | |
184 | 207 | | |
185 | 208 | | |
186 | 209 | | |
| |||
190 | 213 | | |
191 | 214 | | |
192 | 215 | | |
193 | | - | |
| 216 | + | |
194 | 217 | | |
195 | | - | |
196 | | - | |
197 | | - | |
| 218 | + | |
198 | 219 | | |
199 | 220 | | |
200 | 221 | | |
| |||
0 commit comments