Question on UnityContainer

Apr 17, 2012 at 4:40 PM
Edited Apr 17, 2012 at 4:47 PM

public
interface IRateMode { double GetDouble(); int GetInt(); }

public class RateMode:IRateMode
    {
        public double Getdouble ()
        {
            return 100.0;
        }
 public int GetInt()
        {
            return 50;
        }
    }

private void RegistrationService()
        {
            var container = new UnityContainer();
container.RegisterType<IRateMode, RateMode>(new TransientLifetimeManager(), new InjectionConstructor());

container.RegisterType<ISearchProvider, RaitingSearchProvider>("RaitingSearchProvider", new TransientLifetimeManager(),
new InjectionConstructor(
new ResolvedParameter<ISearchProvider>("ConsolidatedSearchProvider"),
new GenericFinalRateAlgorithm(???)));


 var locator = new UnityServiceLocator(container); ServiceLocator.SetLocatorProvider(() => locator); }




??? - How to call the method GetDouble() use registered
 container.RegisterType<IRateMode, RateMode>(new TransientLifetimeManager(), new InjectionConstructor());