Skip to content

Commit 4a61d85

Browse files
committed
Restore missing AppData populated in ScriptContext
1 parent 41c45a4 commit 4a61d85

1 file changed

Lines changed: 23 additions & 5 deletions

File tree

MyApp/Configure.AppHost.cs

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,42 @@
11
using Funq;
22
using MyApp.ServiceInterface;
3+
using MyApp.ServiceModel;
34

45
[assembly: HostingStartup(typeof(MyApp.AppHost))]
56

67
namespace MyApp;
78

8-
public class AppHost : AppHostBase, IHostingStartup
9+
public class AppHost() : AppHostBase("MyApp", typeof(MyServices).Assembly), IHostingStartup
910
{
1011
public void Configure(IWebHostBuilder builder) => builder
1112
.ConfigureServices((context, services) =>
1213
{
1314
// Configure ASP.NET Core IOC Dependencies
1415
});
1516

16-
public AppHost() : base("MyApp", typeof(MyServices).Assembly) { }
17-
1817
// Configure your AppHost with the necessary configuration and dependencies your App needs
1918
public override void Configure(Container container)
2019
{
21-
SetConfig(new HostConfig {
20+
SetConfig(new HostConfig
21+
{
2222
});
23+
24+
ScriptContext.Args[nameof(AppData)] = new AppData
25+
{
26+
Currencies = NumberCurrency.All,
27+
AlphaValues = ["Alpha", "Bravo", "Charlie"],
28+
AlphaDictionary = new()
29+
{
30+
["A"] = "Alpha",
31+
["B"] = "Bravo",
32+
["C"] = "Charlie",
33+
},
34+
AlphaKeyValuePairs = new()
35+
{
36+
new("A", "Alpha"),
37+
new("B", "Bravo"),
38+
new("C", "Charlie"),
39+
},
40+
};
2341
}
24-
}
42+
}

0 commit comments

Comments
 (0)