Exemplo n.º 1
0
 public void Initialize()
 {
     _container.RegisterType<IDataProvider, YaDataProvider>("YaDataProvider");
     _container.RegisterType<IRestService, YaWebService>("YaWebService");
     var s = new YaWebService(_container) {Number = 42};
     _container.RegisterInstance(typeof(YaWebService), s);
     RouteTable.Routes.Add(new ServiceRoute("ya", new UnityServiceHostFactory(_container, typeof(IYaWebService)), typeof(YaWebService)));
 }
Exemplo n.º 2
0
        public void Initialize()
        {
            _container.RegisterType <IDataProvider, YaDataProvider>("YaDataProvider");
            _container.RegisterType <IRestService, YaWebService>("YaWebService");
            var s = new YaWebService(_container)
            {
                Number = 42
            };

            _container.RegisterInstance(typeof(YaWebService), s);
            RouteTable.Routes.Add(new ServiceRoute("ya", new UnityServiceHostFactory(_container, typeof(IYaWebService)), typeof(YaWebService)));
        }