From da024f9812a49363083d1826b115a0dff54a8be1 Mon Sep 17 00:00:00 2001 From: Reuben Bond Date: Thu, 4 May 2023 09:15:40 -0700 Subject: [PATCH] Remove Program.AppName --- .../EventBus/EventBusServiceBus/EventBusServiceBus.cs | 5 ++--- src/Services/Ordering/Ordering.BackgroundTasks/Program.cs | 6 ------ src/Services/Ordering/Ordering.SignalrHub/Program.cs | 5 ----- src/Services/Payment/Payment.API/Program.cs | 5 ----- src/Web/WebMVC/Program.cs | 5 ----- src/Web/WebStatus/Program.cs | 6 ------ 6 files changed, 2 insertions(+), 30 deletions(-) diff --git a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs index 0b350967d..c409717d6 100644 --- a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs +++ b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus; @@ -12,7 +12,6 @@ public class EventBusServiceBus : IEventBus, IAsyncDisposable private readonly string _subscriptionName; private readonly ServiceBusSender _sender; private readonly ServiceBusProcessor _processor; - private readonly string AUTOFAC_SCOPE_NAME = "eshop_event_bus"; private const string INTEGRATION_EVENT_SUFFIX = "IntegrationEvent"; public EventBusServiceBus(IServiceBusPersisterConnection serviceBusPersisterConnection, @@ -198,4 +197,4 @@ public class EventBusServiceBus : IEventBus, IAsyncDisposable _subsManager.Clear(); await _processor.CloseAsync(); } -} \ No newline at end of file +} diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Program.cs b/src/Services/Ordering/Ordering.BackgroundTasks/Program.cs index 35f066fed..de689fd33 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Program.cs +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Program.cs @@ -34,9 +34,3 @@ app.MapHealthChecks("/liveness", new HealthCheckOptions }); await app.RunAsync(); - -public partial class Program -{ - public static string Namespace = typeof(Program).Assembly.GetName().Name; - public static string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1); -} diff --git a/src/Services/Ordering/Ordering.SignalrHub/Program.cs b/src/Services/Ordering/Ordering.SignalrHub/Program.cs index 00b61d63b..160855613 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Program.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/Program.cs @@ -196,11 +196,6 @@ void RegisterEventBus(IServiceCollection services, IConfiguration configuration) services.AddSingleton(); } -public partial class Program -{ - public static string Namespace = typeof(Program).Assembly.GetName().Name; - public static string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1); -} public static class CustomExtensionMethods { public static IServiceCollection AddCustomHealthCheck(this IServiceCollection services, IConfiguration configuration) diff --git a/src/Services/Payment/Payment.API/Program.cs b/src/Services/Payment/Payment.API/Program.cs index 60c7d947f..8c95c4b0d 100644 --- a/src/Services/Payment/Payment.API/Program.cs +++ b/src/Services/Payment/Payment.API/Program.cs @@ -129,11 +129,6 @@ void ConfigureEventBus(IApplicationBuilder app) eventBus.Subscribe(); } -public partial class Program -{ - public static string Namespace = typeof(Program).Assembly.GetName().Name; - public static string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1); -} public static class CustomExtensionMethods { public static IServiceCollection AddCustomHealthCheck(this IServiceCollection services, IConfiguration configuration) diff --git a/src/Web/WebMVC/Program.cs b/src/Web/WebMVC/Program.cs index 3d5eb1511..55e7a1027 100644 --- a/src/Web/WebMVC/Program.cs +++ b/src/Web/WebMVC/Program.cs @@ -149,8 +149,3 @@ static void AddCustomAuthentication(WebApplicationBuilder builder) options.Scope.Add("webhooks"); }); } - -public partial class Program -{ - public static readonly string AppName = typeof(Program).Assembly.GetName().Name; -} diff --git a/src/Web/WebStatus/Program.cs b/src/Web/WebStatus/Program.cs index ddecc6a9e..96c91271e 100644 --- a/src/Web/WebStatus/Program.cs +++ b/src/Web/WebStatus/Program.cs @@ -52,9 +52,3 @@ app.MapHealthChecks("/liveness", new HealthCheckOptions }); await app.RunAsync(); - -public partial class Program -{ - private static readonly string _namespace = typeof(Program).Assembly.GetName().Name; - public static readonly string AppName = _namespace; -}