Closed JerryNixon closed 1 week ago
At the moment config-file can be added manually as a second parameter of AddDataAPIBuilder() has stated in the docs.
Looking at the signature method:
public static IResourceBuilder<DataApiBuilderContainerResource> AddDataAPIBuilder(this IDistributedApplicationBuilder builder,
[ResourceName] string name,
string configFilePath = "./dab-config.json",
int? port = null)
we simply made the default value as dab-config to make it easier to config DAB when the config file has the standard name dab-config and is placed in the AppHost folder.
Following down this path, though, we can create another signature for AddDataAPIBuilder accepting multiple configFiles:
public static IResourceBuilder<DataApiBuilderContainerResource> AddDataAPIBuilder(this IDistributedApplicationBuilder builder,
[ResourceName] string name,
string[] configFilesPath,
int? port = null)
The current syntax:
This does not make it clear how to include configuration files.
I suggest two important methods:
WithConfigurationFile(string)
WithConfigurationFiles(string[])
and
This is important because:
Workaround:
I realize this can be done today with
Mount()
but this undermines the simplicity of the integration.and (multiple configuration files)