Пример #1
0
        public static IServiceBus StartEndpoint()
        {
            var starters = new ReflectionService().GetTypes <IStartEndpoint>().ToList();

            if (starters.Count != 1)
            {
                throw new ApplicationException(string.Format(ESBResources.StartEndpointException, starters.Count()));
            }

            var type = starters.ElementAt(0);

            type.AssertDefaultConstructor(string.Format(ESBResources.StartEndpointRequiresDefaultConstructor, type.FullName));

            return(((IStartEndpoint)Activator.CreateInstance(type)).Start());
        }
Пример #2
0
        public static IServiceBus StartEndpoint()
        {
            var starters = new ReflectionService().GetTypes<IStartEndpoint>().ToList();

            if (starters.Count != 1)
            {
                throw new ApplicationException(string.Format(ESBResources.StartEndpointException, starters.Count()));
            }

            var type = starters.ElementAt(0);

            type.AssertDefaultConstructor(string.Format(ESBResources.StartEndpointRequiresDefaultConstructor, type.FullName));

            return ((IStartEndpoint)Activator.CreateInstance(type)).Start();
        }