Replies: 3 comments 5 replies
-
I assume you are asking about how to access the Configuration through the Server aspect of your module - as you cannot access Configuration from the Client side ( ie. razor components ) directly. Configuration is already registered by Oqtane in DI so you simply need to inject it into your Server class:
And then you can use _config.GetSection(), etc... |
Beta Was this translation helpful? Give feedback.
-
In this case let's say I want to register http service in startup and I need to use different url from production, staging and dev environment. So I need to have access that into ConfigureServices method from StartupClass. @sbwalker Thank you |
Beta Was this translation helpful? Give feedback.
-
This worked for me:
Also see: Using Syncfusion In Oqtane Modules |
Beta Was this translation helpful? Give feedback.
-
I am looking to read appsettings and register in services as shown below.
I got NULL reference error for Configuration when i try to run app from Oqtane Solution. any hint?
public class ServerStartup : IServerStartup
{
public void ConfigureServices(IServiceCollection services)
{
services.Configure(Configuration.GetSection("AppSettings"))
.AddSingleton(x => x.GetRequiredService<IOptions>().Value);
}
Beta Was this translation helpful? Give feedback.
All reactions