You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting up a service using SceneServiceProvider, it seems the service profile configurations are not accessible from the main ServiceProvider. As a result, the TryGetServiceProfile function cannot retrieve the profile for the service, which impacts functionality.
The current implementation of TryGetServiceProfile appears to restrict configuration lookup to only Providers of type ServiceProviderProfile in the rootProfile parameter.
publicboolTryGetServiceProfile<TService,TProfile>(outTProfileprofile,ServiceProvidersProfilerootProfile=null)// rootProfile should be of type BaseServiceProfile<IService>whereTService:IServicewhereTProfile:BaseProfile{if(rootProfile.IsNull()){rootProfile=ActiveProfile;}if(!rootProfile.IsNull()){foreach(varconfigurationinrootProfile.ServiceConfigurations){if(typeof(TService).IsAssignableFrom(configuration.InstancedType)){profile=(TProfile)configuration.Profile;returnprofile!=null;}}}profile=null;returnfalse;}
Changing the rootProfile parameter to BaseServiceProfile<IService> would enable SceneServiceProviderProfile to be passed in. This change should make the configurations accessible and allow TryGetServiceProfile to locate the correct profile, as SceneServiceProviderProfile would contain the necessary configurations.
The text was updated successfully, but these errors were encountered:
I’ve created a pull request to address this issue, which updates the rootProfile parameter type as previously discussed. This adjustment is aimed at providing greater flexibility in accessing service profiles.
For testing, I believe we can cover the essential use cases by calling TryGetServiceProfile with rootProfile instances of both SceneServiceProvidersProfile and ServiceProvidersProfile. Each test should validate that both types can access configurations and retrieve the appropriate profiles for the specified service.
When setting up a service using
SceneServiceProvider
, it seems the service profile configurations are not accessible from the mainServiceProvider
. As a result, theTryGetServiceProfile
function cannot retrieve the profile for the service, which impacts functionality.The current implementation of
TryGetServiceProfile
appears to restrict configuration lookup to only Providers of typeServiceProviderProfile
in therootProfile
parameter.Changing the
rootProfile
parameter toBaseServiceProfile<IService>
would enableSceneServiceProviderProfile
to be passed in. This change should make the configurations accessible and allowTryGetServiceProfile
to locate the correct profile, asSceneServiceProviderProfile
would contain the necessary configurations.The text was updated successfully, but these errors were encountered: