private static string GetXmlCommentsPath() { var assembly = TypeLocator.GetEntryPointAssembly(); var xmlFile = $@"{AppDomain.CurrentDomain.BaseDirectory}\{assembly.GetName().Name}.xml"; return(File.Exists(xmlFile) ? xmlFile : null); }
public void Run(IApplication appInstance) { appInstance.ReportHealthStateAction = (property, state, description) => { }; appInstance.ReportRecurrentHealthStateAction = (property, state, timeToLive, description) => { }; appInstance.GetCodePackageVersionFunction = () => TypeLocator.GetEntryPointAssembly().GetName().Version.ToString(); appInstance.GetDataPackageVersionFunction = packageName => $"{packageName}.{DateTime.Now.Ticks}"; Application.Instance = appInstance; }
private void RegisterServiceBuses(ContainerBuilder builder) { if (initializationParameters.ServiceBusParameters.Any()) { var module = new ServiceBusAutofacModule(initializationParameters.ServiceBusParameters); builder.RegisterModule(module); ServiceBusInterceptorsProvider.Add(new ServiceBusInterceptor()); } if (initializationParameters.ConsumerRegistrator != null) { var entryAssembly = TypeLocator.GetEntryPointAssembly(); var consumers = entryAssembly.GetTypes().Where(x => x.GetInterfaces().Contains(typeof(IConsumer))); var module = new ConsumerAutofacModule(consumers, initializationParameters.ConsumerRegistrator); builder.RegisterModule(module); } }
private void RegisterServiceBuses(IServiceCollection services) { if (StartupParameters.BusInitiators.Any()) { var module = new ServiceBusModule(StartupParameters.BusInitiators.Select(x => new Tuple <Type, IServiceBusInitiator>(x.ConsumerBusType, x.Initiator))); services.RegisterModule(module); ServiceBusInterceptorsProvider.Add(new ServiceBusInterceptor()); } var registrator = StartupParameters.ConsumerRegistrator; if (registrator != null) { var entryAssembly = TypeLocator.GetEntryPointAssembly(); var consumers = entryAssembly.GetTypes().Where(x => x.GetInterfaces().Contains(typeof(IConsumer))); var module = new ConsumerModule(consumers, registrator); services.RegisterModule(module); } }
#pragma warning restore SA1118 // Parameter must not span multiple lines public Version GetAssemblyVersion() { var assembly = TypeLocator.GetEntryPointAssembly(); return(assembly.GetName().Version); }
private static string GetVersion() { return(TypeLocator.GetEntryPointAssembly().GetName().Version.ToString()); }
public ServiceNameEnricher() { var assembly = TypeLocator.GetEntryPointAssembly(); serviceType = assembly.GetTypes().FirstOrDefault(t => t.IsSubclassOf(typeof(ServiceShell))); }