I have created my own ITypeNameConvention class, and have created an initialization module to set the Convention on the current search client. I can see in the debugger that my Initialization module is executing successfully, and I can see that searchcClient.Conventions.TypeNameConvention holds my custom class -- yet when the client service is injected in another block of code, its TypeNameConvention has switched back to Default. How to I ensure that my class is used instead of the default?
[InitializableModule]
[ModuleDependency(typeof(FrameworkInitializationModule))]
public class FindInitialization : IConfigurableModule
{
public void ConfigureContainer(ServiceConfigurationContext context)
{
}
public void Initialize(InitializationEngine context)
{
var searchClient = ServiceLocator.Current.GetInstance();
var typeNameMapper = new CdnTypeNameMapper();
searchClient.Conventions.TypeNameConvention = typeNameMapper;
}
public void Uninitialize(InitializationEngine context)
{
}
}
}
I have created my own ITypeNameConvention class, and have created an initialization module to set the Convention on the current search client. I can see in the debugger that my Initialization module is executing successfully, and I can see that searchcClient.Conventions.TypeNameConvention holds my custom class -- yet when the client service is injected in another block of code, its TypeNameConvention has switched back to Default. How to I ensure that my class is used instead of the default?