Exemple #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)));
 }
Exemple #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)));
        }