I am using Unity for dependency injection and have the instance of a class Config that implements IConfig registered with the Unity Container.
IConfiguration config = new Configuration();
unityContainer.RegisterInstance<IConfiguration>(config);
When the app is running and the user loads a saved configuration, I would like to update the instance stored in Unity with the configuration object loaded. E.g. something like the psuedo code below
IConfiguration loadedConfig = FileLoadService.Load(filepath);
unityContainer.Instance = loadedConfig;
Is this possible?