From 71a4cf64796c6e7306ceaa3ea359f2a54f876ca1 Mon Sep 17 00:00:00 2001 From: Sumit Ghosh Date: Thu, 7 Oct 2021 18:31:06 +0530 Subject: [PATCH] Moved individual usings statements to globalusing --- .../Controllers/CatalogController.cs | 15 +------- .../Catalog.API/Controllers/HomeController.cs | 4 +-- .../Catalog.API/Controllers/PicController.cs | 11 +----- .../Catalog.API/Extensions/HostExtensions.cs | 11 +----- .../Extensions/LinqSelectExtensions.cs | 6 +--- .../Extensions/WebHostExtensions.cs | 11 +----- .../Catalog.API/Grpc/CatalogService.cs | 15 ++------ .../InternalServerErrorObjectResult.cs | 5 +-- .../Infrastructure/CatalogContext.cs | 9 ++--- .../Infrastructure/CatalogContextSeed.cs | 21 ++--------- .../CatalogBrandEntityTypeConfiguration.cs | 6 +--- .../CatalogItemEntityTypeConfiguration.cs | 6 +--- .../CatalogTypeEntityTypeConfiguration.cs | 6 +--- .../Exceptions/CatalogDomainException.cs | 4 +-- .../Filters/HttpGlobalExceptionFilter.cs | 12 +------ .../CatalogIntegrationEventService.cs | 13 +------ ...aitingValidationIntegrationEventHandler.cs | 12 +------ ...tusChangedToPaidIntegrationEventHandler.cs | 9 +---- ...gedToAwaitingValidationIntegrationEvent.cs | 5 +-- .../OrderStockConfirmedIntegrationEvent.cs | 4 +-- .../OrderStockRejectedIntegrationEvent.cs | 5 +-- .../ProductPriceChangedIntegrationEvent.cs | 4 +-- .../ICatalogIntegrationEventService.cs | 5 +-- .../Catalog/Catalog.API/Model/CatalogItem.cs | 5 +-- src/Services/Catalog/Catalog.API/Program.cs | 22 ++---------- src/Services/Catalog/Catalog.API/Startup.cs | 36 +------------------ .../ViewModel/PaginatedItemsViewModel.cs | 5 +-- 27 files changed, 33 insertions(+), 234 deletions(-) diff --git a/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs b/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs index d58c06f66..74a48a766 100644 --- a/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs +++ b/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs @@ -1,17 +1,4 @@ -using Catalog.API.IntegrationEvents; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure; -using Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.Events; -using Microsoft.eShopOnContainers.Services.Catalog.API.Model; -using Microsoft.eShopOnContainers.Services.Catalog.API.ViewModel; -using Microsoft.Extensions.Options; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Threading.Tasks; - +using Microsoft.eShopOnContainers.Services.Catalog.API.Model; namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers { [Route("api/v1/[controller]")] diff --git a/src/Services/Catalog/Catalog.API/Controllers/HomeController.cs b/src/Services/Catalog/Catalog.API/Controllers/HomeController.cs index 37792fb04..bfd73d4ac 100644 --- a/src/Services/Catalog/Catalog.API/Controllers/HomeController.cs +++ b/src/Services/Catalog/Catalog.API/Controllers/HomeController.cs @@ -1,6 +1,4 @@ -using Microsoft.AspNetCore.Mvc; - -// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 +// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers { diff --git a/src/Services/Catalog/Catalog.API/Controllers/PicController.cs b/src/Services/Catalog/Catalog.API/Controllers/PicController.cs index 31c93683c..3220a42f5 100644 --- a/src/Services/Catalog/Catalog.API/Controllers/PicController.cs +++ b/src/Services/Catalog/Catalog.API/Controllers/PicController.cs @@ -1,13 +1,4 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure; -using System.IO; -using System.Net; -using System.Threading.Tasks; - -// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 - +// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers { [ApiController] diff --git a/src/Services/Catalog/Catalog.API/Extensions/HostExtensions.cs b/src/Services/Catalog/Catalog.API/Extensions/HostExtensions.cs index ccdd73558..4aff6009d 100644 --- a/src/Services/Catalog/Catalog.API/Extensions/HostExtensions.cs +++ b/src/Services/Catalog/Catalog.API/Extensions/HostExtensions.cs @@ -1,13 +1,4 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using Polly; -using System; -using System.Data.SqlClient; - -namespace Catalog.API.Extensions +namespace Catalog.API.Extensions { public static class HostExtensions { diff --git a/src/Services/Catalog/Catalog.API/Extensions/LinqSelectExtensions.cs b/src/Services/Catalog/Catalog.API/Extensions/LinqSelectExtensions.cs index 1e5fbf789..a1b7c54a4 100644 --- a/src/Services/Catalog/Catalog.API/Extensions/LinqSelectExtensions.cs +++ b/src/Services/Catalog/Catalog.API/Extensions/LinqSelectExtensions.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Catalog.API.Extensions +namespace Catalog.API.Extensions { public static class LinqSelectExtensions { diff --git a/src/Services/Catalog/Catalog.API/Extensions/WebHostExtensions.cs b/src/Services/Catalog/Catalog.API/Extensions/WebHostExtensions.cs index 07fc11770..780704c58 100644 --- a/src/Services/Catalog/Catalog.API/Extensions/WebHostExtensions.cs +++ b/src/Services/Catalog/Catalog.API/Extensions/WebHostExtensions.cs @@ -1,13 +1,4 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Polly; -using System; -using System.Data.SqlClient; - -namespace Catalog.API.Extensions +namespace Catalog.API.Extensions { public static class WebHostExtensions { diff --git a/src/Services/Catalog/Catalog.API/Grpc/CatalogService.cs b/src/Services/Catalog/Catalog.API/Grpc/CatalogService.cs index 91270b576..f035c6524 100644 --- a/src/Services/Catalog/Catalog.API/Grpc/CatalogService.cs +++ b/src/Services/Catalog/Catalog.API/Grpc/CatalogService.cs @@ -1,24 +1,13 @@ using CatalogApi; -using Grpc.Core; -using Microsoft.EntityFrameworkCore; -using Microsoft.eShopOnContainers.Services.Catalog.API; -using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure; -using Microsoft.eShopOnContainers.Services.Catalog.API.Model; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using static CatalogApi.Catalog; -namespace Catalog.API.Grpc +namespace Microsoft.eShopOnContainers.Services.Catalog.API.Grpc { public class CatalogService : CatalogBase { private readonly CatalogContext _catalogContext; private readonly CatalogSettings _settings; - private readonly ILogger _logger; + private readonly Extensions.Logging.ILogger _logger; public CatalogService(CatalogContext dbContext, IOptions settings, ILogger logger) { diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/ActionResults/InternalServerErrorObjectResult.cs b/src/Services/Catalog/Catalog.API/Infrastructure/ActionResults/InternalServerErrorObjectResult.cs index a6138b476..61954a7ab 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/ActionResults/InternalServerErrorObjectResult.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/ActionResults/InternalServerErrorObjectResult.cs @@ -1,7 +1,4 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; - -namespace Catalog.API.Infrastructure.ActionResults +namespace Catalog.API.Infrastructure.ActionResults { public class InternalServerErrorObjectResult : ObjectResult { diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs index ee440c1ef..7741ac188 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs @@ -1,10 +1,7 @@ -namespace Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure -{ - using EntityConfigurations; - using Microsoft.EntityFrameworkCore; - using Microsoft.EntityFrameworkCore.Design; - using Model; +using Microsoft.eShopOnContainers.Services.Catalog.API.Model; +namespace Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure +{ public class CatalogContext : DbContext { public CatalogContext(DbContextOptions options) : base(options) diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContextSeed.cs b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContextSeed.cs index 5416b377a..8d8bf0e71 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContextSeed.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContextSeed.cs @@ -1,22 +1,7 @@ -namespace Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure -{ - using Extensions.Logging; - using global::Catalog.API.Extensions; - using Microsoft.AspNetCore.Hosting; - using Microsoft.Extensions.Options; - using Model; - using Polly; - using Polly.Retry; - using System; - using System.Collections.Generic; - using System.Data.SqlClient; - using System.Globalization; - using System.IO; - using System.IO.Compression; - using System.Linq; - using System.Text.RegularExpressions; - using System.Threading.Tasks; +using Microsoft.eShopOnContainers.Services.Catalog.API.Model; +namespace Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure +{ public class CatalogContextSeed { public async Task SeedAsync(CatalogContext context, IWebHostEnvironment env, IOptions settings, ILogger logger) diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/EntityConfigurations/CatalogBrandEntityTypeConfiguration.cs b/src/Services/Catalog/Catalog.API/Infrastructure/EntityConfigurations/CatalogBrandEntityTypeConfiguration.cs index 35d307ee3..be089a025 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/EntityConfigurations/CatalogBrandEntityTypeConfiguration.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/EntityConfigurations/CatalogBrandEntityTypeConfiguration.cs @@ -1,8 +1,4 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.eShopOnContainers.Services.Catalog.API.Model; - -namespace Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure.EntityConfigurations +namespace Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure.EntityConfigurations { class CatalogBrandEntityTypeConfiguration : IEntityTypeConfiguration diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/EntityConfigurations/CatalogItemEntityTypeConfiguration.cs b/src/Services/Catalog/Catalog.API/Infrastructure/EntityConfigurations/CatalogItemEntityTypeConfiguration.cs index 33079099c..647f23787 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/EntityConfigurations/CatalogItemEntityTypeConfiguration.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/EntityConfigurations/CatalogItemEntityTypeConfiguration.cs @@ -1,8 +1,4 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.eShopOnContainers.Services.Catalog.API.Model; - -namespace Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure.EntityConfigurations +namespace Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure.EntityConfigurations { class CatalogItemEntityTypeConfiguration : IEntityTypeConfiguration diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/EntityConfigurations/CatalogTypeEntityTypeConfiguration.cs b/src/Services/Catalog/Catalog.API/Infrastructure/EntityConfigurations/CatalogTypeEntityTypeConfiguration.cs index df42826c9..05b860262 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/EntityConfigurations/CatalogTypeEntityTypeConfiguration.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/EntityConfigurations/CatalogTypeEntityTypeConfiguration.cs @@ -1,8 +1,4 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.eShopOnContainers.Services.Catalog.API.Model; - -namespace Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure.EntityConfigurations +namespace Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure.EntityConfigurations { class CatalogTypeEntityTypeConfiguration : IEntityTypeConfiguration diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/Exceptions/CatalogDomainException.cs b/src/Services/Catalog/Catalog.API/Infrastructure/Exceptions/CatalogDomainException.cs index 45295994e..1d0905935 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/Exceptions/CatalogDomainException.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/Exceptions/CatalogDomainException.cs @@ -1,6 +1,4 @@ -using System; - -namespace Catalog.API.Infrastructure.Exceptions +namespace Catalog.API.Infrastructure.Exceptions { /// /// Exception type for app exceptions diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs b/src/Services/Catalog/Catalog.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs index 5ddb81d63..d69a729e6 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/Filters/HttpGlobalExceptionFilter.cs @@ -1,14 +1,4 @@ -using Catalog.API.Infrastructure.ActionResults; -using Catalog.API.Infrastructure.Exceptions; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using System.Net; - -namespace Catalog.API.Infrastructure.Filters +namespace Catalog.API.Infrastructure.Filters { public class HttpGlobalExceptionFilter : IExceptionFilter { diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs index 1ed2783df..f12ea951d 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs @@ -1,15 +1,4 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services; -using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Utilities; -using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure; -using Microsoft.Extensions.Logging; -using System; -using System.Data.Common; -using System.Threading.Tasks; - -namespace Catalog.API.IntegrationEvents +namespace Catalog.API.IntegrationEvents { public class CatalogIntegrationEventService : ICatalogIntegrationEventService, IDisposable { diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs index 95da93f75..5b627370f 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs @@ -1,16 +1,6 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.EventHandling { - using BuildingBlocks.EventBus.Abstractions; - using BuildingBlocks.EventBus.Events; - using global::Catalog.API.IntegrationEvents; - using Infrastructure; - using IntegrationEvents.Events; - using Microsoft.Extensions.Logging; - using Serilog.Context; - using System.Collections.Generic; - using System.Linq; - using System.Threading.Tasks; - + public class OrderStatusChangedToAwaitingValidationIntegrationEventHandler : IIntegrationEventHandler { diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs index 5a9b4a0f8..6eaa8a509 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs @@ -1,12 +1,5 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.EventHandling -{ - using BuildingBlocks.EventBus.Abstractions; - using Infrastructure; - using Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.Events; - using Microsoft.Extensions.Logging; - using Serilog.Context; - using System.Threading.Tasks; - +{ public class OrderStatusChangedToPaidIntegrationEventHandler : IIntegrationEventHandler { diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs index b1061f60e..4ae24de24 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs @@ -1,8 +1,5 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.Events -{ - using BuildingBlocks.EventBus.Events; - using System.Collections.Generic; - +{ public record OrderStatusChangedToAwaitingValidationIntegrationEvent : IntegrationEvent { public int OrderId { get; } diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStockConfirmedIntegrationEvent.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStockConfirmedIntegrationEvent.cs index 6c6a3cfa4..30cfee3c7 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStockConfirmedIntegrationEvent.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStockConfirmedIntegrationEvent.cs @@ -1,7 +1,5 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.Events -{ - using BuildingBlocks.EventBus.Events; - +{ public record OrderStockConfirmedIntegrationEvent : IntegrationEvent { public int OrderId { get; } diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStockRejectedIntegrationEvent.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStockRejectedIntegrationEvent.cs index 7c098edf4..95974dabd 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStockRejectedIntegrationEvent.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStockRejectedIntegrationEvent.cs @@ -1,8 +1,5 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.Events -{ - using BuildingBlocks.EventBus.Events; - using System.Collections.Generic; - +{ public record OrderStockRejectedIntegrationEvent : IntegrationEvent { public int OrderId { get; } diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs index 9f1f504af..978f3f57e 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs @@ -1,7 +1,5 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.Events -{ - using BuildingBlocks.EventBus.Events; - +{ // Integration Events notes: // An Event is “something that has happened in the past”, therefore its name has to be past tense // An Integration Event is an event that can cause side effects to other microservices, Bounded-Contexts or external systems. diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/ICatalogIntegrationEventService.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/ICatalogIntegrationEventService.cs index 4d87e8e94..f53b92cce 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/ICatalogIntegrationEventService.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/ICatalogIntegrationEventService.cs @@ -1,7 +1,4 @@ -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System.Threading.Tasks; - -namespace Catalog.API.IntegrationEvents +namespace Catalog.API.IntegrationEvents { public interface ICatalogIntegrationEventService { diff --git a/src/Services/Catalog/Catalog.API/Model/CatalogItem.cs b/src/Services/Catalog/Catalog.API/Model/CatalogItem.cs index 2e4579f7f..0c41b5d77 100644 --- a/src/Services/Catalog/Catalog.API/Model/CatalogItem.cs +++ b/src/Services/Catalog/Catalog.API/Model/CatalogItem.cs @@ -1,7 +1,4 @@ -using Catalog.API.Infrastructure.Exceptions; -using System; - -namespace Microsoft.eShopOnContainers.Services.Catalog.API.Model +namespace Microsoft.eShopOnContainers.Services.Catalog.API.Model { public class CatalogItem { diff --git a/src/Services/Catalog/Catalog.API/Program.cs b/src/Services/Catalog/Catalog.API/Program.cs index cb6c1e1a6..5eac72955 100644 --- a/src/Services/Catalog/Catalog.API/Program.cs +++ b/src/Services/Catalog/Catalog.API/Program.cs @@ -1,21 +1,5 @@ -using Catalog.API.Extensions; -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Server.Kestrel.Core; -using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; + using Microsoft.eShopOnContainers.Services.Catalog.API; -using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Serilog; -using System; -using System.IO; -using System.Net; -using Azure.Identity; -using Azure.Core; var configuration = GetConfiguration(); @@ -33,9 +17,7 @@ try var settings = services.GetService>(); var logger = services.GetService>(); - new CatalogContextSeed() - .SeedAsync(context, env, settings, logger) - .Wait(); + new CatalogContextSeed().SeedAsync(context, env, settings, logger).Wait(); }) .MigrateDbContext((_, __) => { }); diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index 4c17fb63f..b0ac4ea76 100644 --- a/src/Services/Catalog/Catalog.API/Startup.cs +++ b/src/Services/Catalog/Catalog.API/Startup.cs @@ -1,38 +1,4 @@ -using Autofac; -using Autofac.Extensions.DependencyInjection; -using Catalog.API.Grpc; -using global::Catalog.API.Infrastructure.Filters; -using global::Catalog.API.IntegrationEvents; -using HealthChecks.UI.Client; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Diagnostics.HealthChecks; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Azure.ServiceBus; -using Microsoft.EntityFrameworkCore; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus; -using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; -using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services; -using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure; -using Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.EventHandling; -using Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.Events; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Diagnostics.HealthChecks; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Microsoft.OpenApi.Models; -using RabbitMQ.Client; -using System; -using System.Data.Common; -using System.IO; -using System.Reflection; - -namespace Microsoft.eShopOnContainers.Services.Catalog.API +namespace Microsoft.eShopOnContainers.Services.Catalog.API { public class Startup { diff --git a/src/Services/Catalog/Catalog.API/ViewModel/PaginatedItemsViewModel.cs b/src/Services/Catalog/Catalog.API/ViewModel/PaginatedItemsViewModel.cs index d088d5bb7..177b428dc 100644 --- a/src/Services/Catalog/Catalog.API/ViewModel/PaginatedItemsViewModel.cs +++ b/src/Services/Catalog/Catalog.API/ViewModel/PaginatedItemsViewModel.cs @@ -1,8 +1,5 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.ViewModel -{ - using System.Collections.Generic; - - +{ public class PaginatedItemsViewModel where TEntity : class { public int PageIndex { get; private set; }