ServiceLocator and InjectionConstructor and InjectionMembers

Topics: Questions
Mar 8, 2013 at 8:44 AM
How is it possible to use the ServiceLocator InjectionConstructor or InjectionMembers?
Mar 26, 2013 at 9:10 AM
Not possible?
Coordinator
Mar 26, 2013 at 9:17 AM
Hmmm, missed this one, sorry. That's not supported yet.
May 3, 2013 at 6:49 AM
Hello again.

Maybe there is an other solution. Wan't to register an class wich have an string as Constructorparameter. How to register?
Coordinator
May 3, 2013 at 10:18 AM
We have added an extension method in the latest version:

ResolveTypeUsingParameters

Please see if that fits your needs.
May 3, 2013 at 1:04 PM
Can not find any help to this.

Maybe you can help me.

Try to initialize my DatabaseConnctionString. Thats the way I do it now. With the Unity Container.
            var imInfo = new InjectionMember[]
                    {
                        new InjectionProperty("DatabaseName", Properties.Settings.Default.DatabaseName),
                        new InjectionProperty("ServerName", Properties.Settings.Default.ServerName),
                        new InjectionProperty("ProviderName", Properties.Settings.Default.ProviderName),
                        new InjectionProperty("Metadata", Properties.Settings.Default.Metadata),
                        new InjectionProperty("MultipleActiveResultSets", Properties.Settings.Default.MultipleActiveResultSets),
                        new InjectionProperty("IntegratedSecurity", Properties.Settings.Default.IntegratedSecurity)
                    };

            IoCHelper.UnityContainer.RegisterType<DatabaseInfo>(imInfo);
Coordinator
May 3, 2013 at 3:27 PM
No, property injection is not supported, nor is it on the roadmap.