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()); }
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(); }