File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,11 +6,15 @@ app settings editor - powered by Roslyn
66
77 Autogenerates controller API for appsettings.json
88 Add 2 NUGET references:
9+
910 appSettingEditorAPI
1011 appSettingsEditor
1112
1213 The csproj looks like this
13- ```xml
14+
15+
16+ ``` xml
17+
1418<ItemGroup >
1519 <AdditionalFiles Include =" appsettings.json" >
1620 <CopyToOutputDirectory >PreserveNewest</CopyToOutputDirectory >
@@ -21,30 +25,33 @@ app settings editor - powered by Roslyn
2125 <CompilerGeneratedFilesOutputPath >$(BaseIntermediateOutputPath)Generated</CompilerGeneratedFilesOutputPath >
2226</PropertyGroup >
2327
24- ```
28+ ```
2529
2630 If you want to see a GUI for settings , please do
27- ```csharp
28- app.UseEndpoints(endpoints =>
29- {
30- endpoints.MapControllers(); // add next line
31- endpoints.MapSettingsView <appsettings>(Configuration);
32- });
31+
32+ ``` csharp
33+ app .UseEndpoints (endpoints =>
34+ {
35+ endpoints .MapControllers (); // add next line
36+ endpoints .MapSettingsView <appsettings >(Configuration );
37+ });
38+ ```
3339
3440 If you want to handle security, add
3541
36- public partial class appsettingsController : ControllerBase
37- {
38- //private partial void BeforeGet(appsettings data)
39- //{
42+ ``` csharp
43+ public partial class appsettingsController : ControllerBase
44+ {
45+ // private partial void BeforeGet(appsettings data)
46+ // {
4047
41- //}
42- //private partial void BeforeSave(appsettings data, appsettings original)
43- //{
48+ // }
49+ // private partial void BeforeSave(appsettings data, appsettings original)
50+ // {
4451
45- //}
52+ // }
4653
47- }
48- ```
54+ }
55+ ```
4956
5057
You can’t perform that action at this time.
0 commit comments