Ejemplo n.º 1
0
        public void RegisterService(Type serviceType)
        {
            try
            {
                if (!IsServiceType(serviceType))
                {
                    throw new ArgumentException($"Type {serviceType.FullName} is not a Web Service that implements IService");
                }

                RegisterService(typeFactory, serviceType);
                appHost.Container.RegisterAutoWiredType(serviceType);
            }
            catch (Exception ex)
            {
                appHost.NotifyStartupException(ex);
                Log.Error(ex.Message, ex);
            }
        }
Ejemplo n.º 2
0
        public void RegisterService(Type serviceType)
        {
            try
            {
                var isNService = typeof(IService).IsAssignableFrom(serviceType);
                if (!isNService)
                {
                    throw new ArgumentException("Type {0} is not a Web Service that inherits IService".Fmt(serviceType.FullName));
                }

                RegisterService(typeFactory, serviceType);
                appHost.Container.RegisterAutoWiredType(serviceType);
            }
            catch (Exception ex)
            {
                appHost.NotifyStartupException(ex);
                Log.Error(ex.Message, ex);
            }
        }