Remove Program.AppName

This commit is contained in:
Reuben Bond 2023-05-04 09:15:40 -07:00
parent 8da0a81514
commit da024f9812
6 changed files with 2 additions and 30 deletions

View File

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

View File

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

View File

@ -196,11 +196,6 @@ void RegisterEventBus(IServiceCollection services, IConfiguration configuration)
services.AddSingleton<IEventBusSubscriptionsManager, InMemoryEventBusSubscriptionsManager>();
}
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)

View File

@ -129,11 +129,6 @@ void ConfigureEventBus(IApplicationBuilder app)
eventBus.Subscribe<OrderStatusChangedToStockConfirmedIntegrationEvent, OrderStatusChangedToStockConfirmedIntegrationEventHandler>();
}
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)

View File

@ -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;
}

View File

@ -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;
}