From 586622c3e7a28050a742d0b2560a2cde6e59bc58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borja=20Garc=C3=ADa=20Rodr=C3=ADguez?= Date: Wed, 20 Jan 2021 17:07:01 +0100 Subject: [PATCH 1/4] use identity internal network --- .../archived/helm/ordering-signalrhub/templates/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/k8s/archived/helm/ordering-signalrhub/templates/configmap.yaml b/deploy/k8s/archived/helm/ordering-signalrhub/templates/configmap.yaml index bab4ebc94..98e94b3c3 100644 --- a/deploy/k8s/archived/helm/ordering-signalrhub/templates/configmap.yaml +++ b/deploy/k8s/archived/helm/ordering-signalrhub/templates/configmap.yaml @@ -15,4 +15,4 @@ data: all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" signalr__StoreConnectionString: {{ .Values.inf.redis.keystore.constr }} - urls__IdentityUrl: http://{{ $identity }} \ No newline at end of file + urls__IdentityUrl: http://identity-api \ No newline at end of file From 9b0366f13ca89adf6357cfc0ff33b8620d1cd477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borja=20Garc=C3=ADa=20Rodr=C3=ADguez?= Date: Wed, 20 Jan 2021 17:10:34 +0100 Subject: [PATCH 2/4] fix identity url in current helm version --- deploy/k8s/helm/ordering-signalrhub/templates/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/k8s/helm/ordering-signalrhub/templates/configmap.yaml b/deploy/k8s/helm/ordering-signalrhub/templates/configmap.yaml index bab4ebc94..98e94b3c3 100644 --- a/deploy/k8s/helm/ordering-signalrhub/templates/configmap.yaml +++ b/deploy/k8s/helm/ordering-signalrhub/templates/configmap.yaml @@ -15,4 +15,4 @@ data: all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" signalr__StoreConnectionString: {{ .Values.inf.redis.keystore.constr }} - urls__IdentityUrl: http://{{ $identity }} \ No newline at end of file + urls__IdentityUrl: http://identity-api \ No newline at end of file From ce100401d88800c3b0bc661165f735754d054ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borja=20Garc=C3=ADa=20Rodr=C3=ADguez?= Date: Wed, 20 Jan 2021 17:14:25 +0100 Subject: [PATCH 3/4] revert archived --- .../archived/helm/ordering-signalrhub/templates/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/k8s/archived/helm/ordering-signalrhub/templates/configmap.yaml b/deploy/k8s/archived/helm/ordering-signalrhub/templates/configmap.yaml index 98e94b3c3..bab4ebc94 100644 --- a/deploy/k8s/archived/helm/ordering-signalrhub/templates/configmap.yaml +++ b/deploy/k8s/archived/helm/ordering-signalrhub/templates/configmap.yaml @@ -15,4 +15,4 @@ data: all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}" all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}" signalr__StoreConnectionString: {{ .Values.inf.redis.keystore.constr }} - urls__IdentityUrl: http://identity-api \ No newline at end of file + urls__IdentityUrl: http://{{ $identity }} \ No newline at end of file From 2b9117066224758c0871c550546856bbf44d44e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Borja=20Garc=C3=ADa=20Rodr=C3=ADguez?= Date: Wed, 20 Jan 2021 17:57:32 +0100 Subject: [PATCH 4/4] clean up solution --- .../aggregator/Models/OrderData.cs | 2 +- .../Models/UpdateBasketItemsRequest.cs | 2 +- .../aggregator/Models/UpdateBasketRequest.cs | 2 +- .../aggregator/Services/BasketService.cs | 2 - .../aggregator/Services/OrderingService.cs | 3 -- .../aggregator/Config/UrlsConfig.cs | 2 +- .../aggregator/Services/BasketService.cs | 2 - .../aggregator/Services/OrderingService.cs | 3 -- .../Web.Bff.Shopping/aggregator/Startup.cs | 4 +- .../DevspacesMessageHandler.cs | 1 - .../HttpClientBuilderDevspacesExtensions.cs | 3 -- .../ServiceCollectionDevspacesExtensions.cs | 3 -- .../IDynamicIntegrationEventHandler.cs | 6 +-- .../EventBus/Abstractions/IEventBus.cs | 1 - .../Abstractions/IIntegrationEventHandler.cs | 4 +- .../EventBus/Events/IntegrationEvent.cs | 4 +- .../Extensions/GenericTypeExtensions.cs | 2 - .../InMemoryEventBusSubscriptionsManager.cs | 6 +-- .../EventBus/EventBus/SubscriptionInfo.cs | 2 +- .../DefaultServiceBusPersisterConnection.cs | 8 ++-- .../IntegrationEventLogEF/EventStateEnum.cs | 6 +-- .../IntegrationEventLogContext.cs | 7 +--- .../IntegrationEventLogEntry.cs | 13 ++----- .../Services/IIntegrationEventLogService.cs | 2 - .../Services/IntegrationEventLogService.cs | 18 ++++----- .../Utilities/ResilientTransaction.cs | 10 +---- ...orizationHeaderParameterOperationFilter.cs | 1 - .../Controllers/BasketController.cs | 5 +-- .../Basket/Basket.API/Grpc/BasketService.cs | 1 - .../Middlewares/FailingMiddleware.cs | 4 +- .../Middlewares/FailingOptions.cs | 2 +- .../OrderStartedIntegrationEventHandler.cs | 1 - .../Events/OrderStartedIntegrationEvent.cs | 2 +- .../ProductPriceChangedIntegrationEvent.cs | 2 +- .../Basket/Basket.API/Model/BasketItem.cs | 2 +- src/Services/Basket/Basket.API/Program.cs | 3 +- .../Basket.API/Services/IdentityService.cs | 2 +- src/Services/Basket/Basket.API/Startup.cs | 39 +++++++++---------- .../Base/BasketTestStartup.cs | 6 +-- .../Basket.FunctionalTests/BasketScenarios.cs | 2 +- .../RedisBasketRepositoryTests.cs | 4 +- .../Controllers/CatalogController.cs | 12 +++--- .../Extensions/CatalogItemExtensions.cs | 7 +--- .../Catalog.API/Extensions/HostExtensions.cs | 7 +--- .../Extensions/WebHostExtensions.cs | 6 +-- .../Catalog.API/Grpc/CatalogService.cs | 11 +++--- .../Infrastructure/CatalogContext.cs | 8 ++-- .../Infrastructure/CatalogContextSeed.cs | 14 +++---- .../20161103152832_Initial.cs | 4 +- .../20161103153420_UpdateTableNames.cs | 4 +- .../20170314083211_AddEventTable.cs | 5 +-- ...012921_RefactoringToIntegrationEventLog.cs | 5 +-- ...316120022_RefactoringEventBusNamespaces.cs | 4 +- ...170322124244_RemoveIntegrationEventLogs.cs | 5 +-- .../20170509130025_AddStockProductItem.cs | 4 +- .../20170530133114_AddPictureFileName.cs | 4 +- .../CatalogContextModelSnapshot.cs | 4 +- .../20170322145434_IntegrationEventInitial.cs | 5 +-- .../CatalogIntegrationEventService.cs | 7 +--- ...aitingValidationIntegrationEventHandler.cs | 12 +++--- ...tusChangedToPaidIntegrationEventHandler.cs | 4 +- ...rderStatusChangedToPaidIntegrationEvent.cs | 2 +- .../ProductPriceChangedIntegrationEvent.cs | 2 +- src/Services/Catalog/Catalog.API/Startup.cs | 3 +- .../CatalogScenarioBase.cs | 1 - .../Controllers/AccountController.cs | 11 +++--- .../Controllers/ConsentController.cs | 2 +- .../Controllers/HomeController.cs | 2 +- .../Data/ApplicationDbContextSeed.cs | 10 ++--- .../Data/ConfigurationDbContextSeed.cs | 5 +-- .../IdentityDevspacesBuilderExtensions.cs | 4 -- .../20190729091724_InitialMigration.cs | 4 +- ...729092011_InitialConfigurationMigration.cs | 4 +- ...29092100_InitialPersistedGrantMigration.cs | 4 +- .../AccountViewModels/ConsentViewModel.cs | 4 +- .../Identity.API/Services/EFLoginService.cs | 4 +- .../Identity.API/Services/ILoginService.cs | 4 +- .../Identity.API/Services/RedirectService.cs | 2 +- .../Application/Behaviors/LoggingBehavior.cs | 3 +- .../Behaviors/ValidatorBehavior.cs | 2 +- .../Commands/CancelOrderCommand.cs | 4 -- .../Commands/CancelOrderCommandHandler.cs | 2 +- .../Commands/CreateOrderCommand.cs | 9 ++--- .../Commands/CreateOrderDraftCommand.cs | 10 +---- .../CreateOrderDraftCommandHandler.cs | 2 +- .../Commands/IdentifiedCommandHandler.cs | 2 - ...SetAwaitingValidationOrderStatusCommand.cs | 4 -- ...tingValidationOrderStatusCommandHandler.cs | 4 +- .../Commands/SetPaidOrderStatusCommand.cs | 4 -- .../SetPaidOrderStatusCommandHandler.cs | 4 +- .../SetStockConfirmedOrderStatusCommand.cs | 4 -- ...StockConfirmedOrderStatusCommandHandler.cs | 4 +- .../SetStockRejectedOrderStatusCommand.cs | 3 -- ...tStockRejectedOrderStatusCommandHandler.cs | 6 +-- .../Application/Commands/ShipOrderCommand.cs | 4 -- ...dToAwaitingValidationDomainEventHandler.cs | 4 +- ...erStatusChangedToPaidDomainEventHandler.cs | 8 ++-- .../OrderShippedDomainEventHandler.cs | 2 +- ...tomerWhenOrderStartedDomainEventHandler.cs | 16 ++------ ...egateWhenOrderStartedDomainEventHandler.cs | 1 - ...angedToStockConfirmedDomainEventHandler.cs | 6 +-- ...ePeriodConfirmedIntegrationEventHandler.cs | 3 -- ...derPaymentFailedIntegrationEventHandler.cs | 7 +--- ...PaymentSucceededIntegrationEventHandler.cs | 5 +-- ...erStockConfirmedIntegrationEventHandler.cs | 13 +++---- ...derStockRejectedIntegrationEventHandler.cs | 13 +++---- ...CheckoutAcceptedIntegrationEventHandler.cs | 6 +-- .../Events/OrderStartedIntegrationEvent.cs | 4 -- ...gedToAwaitingValidationIntegrationEvent.cs | 2 +- ...tatusChangedToCancelledIntegrationEvent.cs | 4 -- ...rderStatusChangedToPaidIntegrationEvent.cs | 2 +- ...rStatusChangedToShippedIntegrationEvent.cs | 4 -- ...tatusChangedTosubmittedIntegrationEvent.cs | 4 -- .../OrderingIntegrationEventService.cs | 5 --- .../Application/Models/BasketItem.cs | 7 +--- .../Application/Models/CustomerBasket.cs | 5 +-- .../Application/Queries/OrderQueries.cs | 4 +- .../Validations/IdentifiedCommandValidator.cs | 2 +- .../Controllers/OrdersController.cs | 11 +++--- .../Extensions/BasketItemExtensions.cs | 6 +-- .../Ordering.API/Grpc/OrderingService.cs | 14 +++---- ...orizationHeaderParameterOperationFilter.cs | 1 - .../AutofacModules/ApplicationModule.cs | 2 +- .../AutofacModules/MediatorModule.cs | 6 +-- .../Factories/OrderingDbContextFactory.cs | 18 ++------- .../20170330131634_IntegrationEventInitial.cs | 5 +-- .../Migrations/20170208181933_Initial.cs | 5 +-- .../20170303085729_RequestsTable.cs | 5 +-- .../20170313100034_Domain_events.cs | 4 +- .../20170403082405_NoBuyerPropertyInOrder.cs | 4 +- ...05110939_NoPaymentMethodPropertyInOrder.cs | 4 +- .../20170511112333_AddOrderDescription.cs | 4 +- .../20170713111342_AdressAsValueObject.cs | 2 - .../20180412143935_NamePropertyInBuyer.cs | 4 +- ...0190808132242_Change_Relation_Of_Orders.cs | 2 +- .../Infrastructure/OrderingContextSeed.cs | 6 +-- .../Services/IIdentityService.cs | 7 +--- .../Services/IdentityService.cs | 5 +-- .../Ordering.BackgroundTasks/Startup.cs | 5 +-- .../AggregatesModel/BuyerAggregate/Buyer.cs | 9 +++-- .../BuyerAggregate/PaymentMethod.cs | 2 +- .../OrderAggregate/IOrderRepository.cs | 2 +- .../OrderAggregate/OrderItem.cs | 7 ++-- .../Events/OrderCancelledDomainEvent.cs | 3 -- .../Events/OrderShippedDomainEvent.cs | 2 +- .../Events/OrderStartedDomainEvent.cs | 6 +-- .../Exceptions/OrderingDomainException.cs | 2 - .../Ordering.Domain/SeedWork/Entity.cs | 6 +-- .../SeedWork/IAggregateRoot.cs | 2 +- .../Ordering.Domain/SeedWork/IUnitOfWork.cs | 2 +- .../OrderingScenarioBase.cs | 19 ++++----- .../OrderingTestStartup.cs | 4 +- .../Idempotency/RequestManager.cs | 6 +-- .../Repositories/BuyerRepository.cs | 2 +- .../Repositories/OrderRepository.cs | 3 +- .../AutofacModules/ApplicationModule.cs | 4 -- ...aitingValidationIntegrationEventHandler.cs | 2 - ...angedToCancelledIntegrationEventHandler.cs | 2 - ...ChangedToShippedIntegrationEventHandler.cs | 2 - ...ToStockConfirmedIntegrationEventHandler.cs | 2 - ...angedToSubmittedIntegrationEventHandler.cs | 2 - ...gedToAwaitingValidationIntegrationEvent.cs | 1 - ...tatusChangedToCancelledIntegrationEvent.cs | 4 -- ...rderStatusChangedToPaidIntegrationEvent.cs | 4 -- ...rStatusChangedToShippedIntegrationEvent.cs | 4 -- ...tatusChangedToSubmittedIntegrationEvent.cs | 4 -- .../Ordering.SignalrHub/NotificationHub.cs | 2 - .../Ordering/Ordering.SignalrHub/Program.cs | 9 ++--- .../Ordering/Ordering.SignalrHub/Startup.cs | 2 +- .../IdentifiedCommandHandlerTest.cs | 5 +-- .../Application/NewOrderCommandHandlerTest.cs | 4 +- .../Ordering/Ordering.UnitTests/Builders.cs | 14 +++---- .../Domain/BuyerAggregateTest.cs | 4 +- .../Domain/OrderAggregateTest.cs | 7 ++-- .../Domain/SeedWork/ValueObjectTests.cs | 1 - .../Controllers/WebhooksController.cs | 2 +- .../Exceptions/WebhooksDomainException.cs | 3 -- .../HttpGlobalExceptionFilter.cs | 4 -- .../Infrastructure/WebhooksContext.cs | 4 -- ...rderStatusChangedToPaidIntegrationEvent.cs | 3 -- ...tusChangedToPaidIntegrationEventHandler.cs | 6 +-- ...ChangedToShippedIntegrationEventHandler.cs | 6 +-- ...ductPriceChangedIntegrationEventHandler.cs | 3 -- .../Migrations/20190118091148_Initial.cs | 4 +- .../Webhooks.API/Model/WebhookData.cs | 5 +-- .../Webhooks.API/Model/WebhookSubscription.cs | 3 -- .../Webhooks.API/Model/WebhookType.cs | 7 +--- src/Services/Webhooks/Webhooks.API/Program.cs | 7 +--- .../Services/IGrantUrlTesterService.cs | 5 +-- .../Services/IWebhooksRetriever.cs | 4 +- .../Webhooks.API/Services/IdentityService.cs | 2 +- .../Services/WebhooksRetriever.cs | 1 - src/Services/Webhooks/Webhooks.API/Startup.cs | 3 +- .../Extensions/HttpClientExtensions.cs | 2 - .../Middleware/AutoAuthorizeMiddleware.cs | 3 -- .../Services/Catalog/CatalogScenariosBase.cs | 7 ++-- .../Services/IntegrationEventsScenarios.cs | 13 +++---- .../Services/Ordering/OrderingScenarios.cs | 16 ++++---- .../Services/Ordering/OrderingTestsStartup.cs | 4 -- src/Web/WebMVC/AppSettings.cs | 7 +--- .../WebMVC/Controllers/CatalogController.cs | 15 ++++--- .../Controllers/OrderManagementController.cs | 13 +++---- src/Web/WebMVC/Controllers/TestController.cs | 2 +- .../WebMVC/Extensions/HttpClientExtensions.cs | 3 -- .../WebMVC/Extensions/SessionExtensions.cs | 4 -- .../HttpClientRequestIdDelegatingHandler.cs | 2 +- .../WebMVC/Infrastructure/WebContextSeed.cs | 6 +-- src/Web/WebMVC/Services/BasketService.cs | 6 +-- src/Web/WebMVC/Services/IBasketService.cs | 2 - src/Web/WebMVC/Services/ICatalogService.cs | 2 - src/Web/WebMVC/Services/IIdentityParser.cs | 6 +-- src/Web/WebMVC/Services/IOrderingService.cs | 2 - src/Web/WebMVC/Services/IdentityParser.cs | 4 +- .../WebMVC/Services/ModelDTOs/BasketDTO.cs | 4 +- src/Web/WebMVC/Startup.cs | 11 +++--- src/Web/WebMVC/ViewComponents/Cart.cs | 7 +--- src/Web/WebMVC/ViewComponents/CartList.cs | 6 +-- .../ViewModels/Annotations/CardExpiration.cs | 6 +-- .../Annotations/LongitudeCoordinate.cs | 2 +- src/Web/WebMVC/ViewModels/ApplicationUser.cs | 6 +-- src/Web/WebMVC/ViewModels/Basket.cs | 2 +- src/Web/WebMVC/ViewModels/Order.cs | 8 ++-- src/Web/WebSPA/AppSettings.cs | 7 +--- src/Web/WebSPA/Program.cs | 8 ++-- .../Server/Controllers/HomeController.cs | 4 +- src/Web/WebSPA/Startup.cs | 2 +- .../WebStatus/Controllers/HomeController.cs | 4 +- .../Controllers/WebhooksReceivedController.cs | 7 +--- src/Web/WebhookClient/HeaderNames.cs | 7 +--- ...ttpClientAuthorizationDelegatingHandler.cs | 2 - .../WebhookClient/Models/WebHookReceived.cs | 3 -- src/Web/WebhookClient/Models/WebhookData.cs | 3 -- .../WebhookClient/Models/WebhookResponse.cs | 3 -- .../Models/WebhookSubscriptionRequest.cs | 7 +--- src/Web/WebhookClient/Pages/Error.cshtml.cs | 6 +-- src/Web/WebhookClient/Pages/Index.cshtml.cs | 6 +-- src/Web/WebhookClient/Pages/Privacy.cshtml.cs | 7 +--- .../Pages/RegisterWebhook.cshtml.cs | 14 +++---- .../Pages/WebhooksList.cshtml.cs | 5 +-- .../Services/IHooksRepository.cs | 4 +- .../Services/InMemoryHooksRepository.cs | 3 +- .../WebhookClient/Services/WebhooksClient.cs | 1 - src/Web/WebhookClient/Settings.cs | 7 +--- 243 files changed, 394 insertions(+), 827 deletions(-) diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/OrderData.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/OrderData.cs index 44749ff6c..3ecddcf36 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/OrderData.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/OrderData.cs @@ -42,7 +42,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models public string Buyer { get; set; } - public List OrderItems { get; } = new List(); + public List OrderItems { get; } = new List(); } } diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketItemsRequest.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketItemsRequest.cs index c5a6ccb3e..066f01a9c 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketItemsRequest.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketItemsRequest.cs @@ -5,7 +5,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models public class UpdateBasketItemsRequest { - + public string BasketId { get; set; } public ICollection Updates { get; set; } diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketRequest.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketRequest.cs index a1c255551..f8fb7eb03 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketRequest.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Models/UpdateBasketRequest.cs @@ -2,7 +2,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models { - + public class UpdateBasketRequest { public string BuyerId { get; set; } diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs index 29f02e720..d6217175b 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs @@ -1,8 +1,6 @@ using GrpcBasket; -using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config; using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; using System.Linq; using System.Threading.Tasks; diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/OrderingService.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/OrderingService.cs index 0e04c9c22..7f9d5deb7 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/OrderingService.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/OrderingService.cs @@ -1,10 +1,7 @@ using GrpcOrdering; -using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config; using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Config/UrlsConfig.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Config/UrlsConfig.cs index b16530e1b..b19874aac 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Config/UrlsConfig.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Config/UrlsConfig.cs @@ -20,7 +20,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config public class BasketOperations { public static string GetItemById(string id) => $"/api/v1/basket/{id}"; - + public static string UpdateBasket() => "/api/v1/basket"; } diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs index 7b526a5b9..648a386c8 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/BasketService.cs @@ -1,8 +1,6 @@ using GrpcBasket; -using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config; using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; using System.Linq; using System.Threading.Tasks; diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/OrderingService.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/OrderingService.cs index 5ab8045c2..ab01b20f5 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/OrderingService.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/OrderingService.cs @@ -1,10 +1,7 @@ using GrpcOrdering; using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; -using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; using System.Linq; -using System.Net.Http; using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs index 5cb69ecc7..99780f66f 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs @@ -44,7 +44,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator .AddUrlGroup(new Uri(Configuration["BasketUrlHC"]), name: "basketapi-check", tags: new string[] { "basketapi" }) .AddUrlGroup(new Uri(Configuration["IdentityUrlHC"]), name: "identityapi-check", tags: new string[] { "identityapi" }) .AddUrlGroup(new Uri(Configuration["PaymentUrlHC"]), name: "paymentapi-check", tags: new string[] { "paymentapi" }); - + services.AddCustomMvc(Configuration) .AddCustomAuthentication(Configuration) .AddDevspaces() @@ -142,7 +142,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator Version = "v1", Description = "Shopping Aggregator for Web Clients" }); - + options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme { Type = SecuritySchemeType.OAuth2, diff --git a/src/BuildingBlocks/Devspaces.Support/DevspacesMessageHandler.cs b/src/BuildingBlocks/Devspaces.Support/DevspacesMessageHandler.cs index 0895b752a..43dfa82f1 100644 --- a/src/BuildingBlocks/Devspaces.Support/DevspacesMessageHandler.cs +++ b/src/BuildingBlocks/Devspaces.Support/DevspacesMessageHandler.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Http; -using System; using System.Collections.Generic; using System.Net.Http; using System.Threading; diff --git a/src/BuildingBlocks/Devspaces.Support/HttpClientBuilderDevspacesExtensions.cs b/src/BuildingBlocks/Devspaces.Support/HttpClientBuilderDevspacesExtensions.cs index 60108301d..00367b26c 100644 --- a/src/BuildingBlocks/Devspaces.Support/HttpClientBuilderDevspacesExtensions.cs +++ b/src/BuildingBlocks/Devspaces.Support/HttpClientBuilderDevspacesExtensions.cs @@ -1,7 +1,4 @@ using Microsoft.Extensions.DependencyInjection; -using System; -using System.Collections.Generic; -using System.Text; namespace Devspaces.Support { diff --git a/src/BuildingBlocks/Devspaces.Support/ServiceCollectionDevspacesExtensions.cs b/src/BuildingBlocks/Devspaces.Support/ServiceCollectionDevspacesExtensions.cs index 0ac5c9e1b..d196c9184 100644 --- a/src/BuildingBlocks/Devspaces.Support/ServiceCollectionDevspacesExtensions.cs +++ b/src/BuildingBlocks/Devspaces.Support/ServiceCollectionDevspacesExtensions.cs @@ -1,7 +1,4 @@ using Microsoft.Extensions.DependencyInjection; -using System; -using System.Collections.Generic; -using System.Text; namespace Devspaces.Support { diff --git a/src/BuildingBlocks/EventBus/EventBus/Abstractions/IDynamicIntegrationEventHandler.cs b/src/BuildingBlocks/EventBus/EventBus/Abstractions/IDynamicIntegrationEventHandler.cs index 55d62ade2..c26ee6a81 100644 --- a/src/BuildingBlocks/EventBus/EventBus/Abstractions/IDynamicIntegrationEventHandler.cs +++ b/src/BuildingBlocks/EventBus/EventBus/Abstractions/IDynamicIntegrationEventHandler.cs @@ -1,8 +1,4 @@ -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading.Tasks; +using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions { diff --git a/src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs b/src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs index dde05e1e3..4c9758a40 100644 --- a/src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs +++ b/src/BuildingBlocks/EventBus/EventBus/Abstractions/IEventBus.cs @@ -1,5 +1,4 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System; namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions { diff --git a/src/BuildingBlocks/EventBus/EventBus/Abstractions/IIntegrationEventHandler.cs b/src/BuildingBlocks/EventBus/EventBus/Abstractions/IIntegrationEventHandler.cs index 828aed26a..99735b871 100644 --- a/src/BuildingBlocks/EventBus/EventBus/Abstractions/IIntegrationEventHandler.cs +++ b/src/BuildingBlocks/EventBus/EventBus/Abstractions/IIntegrationEventHandler.cs @@ -3,8 +3,8 @@ using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions { - public interface IIntegrationEventHandler : IIntegrationEventHandler - where TIntegrationEvent: IntegrationEvent + public interface IIntegrationEventHandler : IIntegrationEventHandler + where TIntegrationEvent : IntegrationEvent { Task Handle(TIntegrationEvent @event); } diff --git a/src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEvent.cs b/src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEvent.cs index 3fc04c1b0..201dcf6b5 100644 --- a/src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEvent.cs +++ b/src/BuildingBlocks/EventBus/EventBus/Events/IntegrationEvent.cs @@ -1,5 +1,5 @@ -using System; -using Newtonsoft.Json; +using Newtonsoft.Json; +using System; namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events { diff --git a/src/BuildingBlocks/EventBus/EventBus/Extensions/GenericTypeExtensions.cs b/src/BuildingBlocks/EventBus/EventBus/Extensions/GenericTypeExtensions.cs index de5a2cb79..775c29c3e 100644 --- a/src/BuildingBlocks/EventBus/EventBus/Extensions/GenericTypeExtensions.cs +++ b/src/BuildingBlocks/EventBus/EventBus/Extensions/GenericTypeExtensions.cs @@ -1,7 +1,5 @@ using System; -using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions { diff --git a/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs b/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs index ea1aca61e..a86248f01 100644 --- a/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs +++ b/src/BuildingBlocks/EventBus/EventBus/InMemoryEventBusSubscriptionsManager.cs @@ -1,8 +1,8 @@ -using System; +using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; +using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; +using System; using System.Collections.Generic; using System.Linq; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus { diff --git a/src/BuildingBlocks/EventBus/EventBus/SubscriptionInfo.cs b/src/BuildingBlocks/EventBus/EventBus/SubscriptionInfo.cs index a20b3031c..9e61034a0 100644 --- a/src/BuildingBlocks/EventBus/EventBus/SubscriptionInfo.cs +++ b/src/BuildingBlocks/EventBus/EventBus/SubscriptionInfo.cs @@ -7,7 +7,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBus public class SubscriptionInfo { public bool IsDynamic { get; } - public Type HandlerType{ get; } + public Type HandlerType { get; } private SubscriptionInfo(bool isDynamic, Type handlerType) { diff --git a/src/BuildingBlocks/EventBus/EventBusServiceBus/DefaultServiceBusPersisterConnection.cs b/src/BuildingBlocks/EventBus/EventBusServiceBus/DefaultServiceBusPersisterConnection.cs index a3f563c2f..881c7668e 100644 --- a/src/BuildingBlocks/EventBus/EventBusServiceBus/DefaultServiceBusPersisterConnection.cs +++ b/src/BuildingBlocks/EventBus/EventBusServiceBus/DefaultServiceBusPersisterConnection.cs @@ -4,7 +4,7 @@ using System; namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus { - public class DefaultServiceBusPersisterConnection :IServiceBusPersisterConnection + public class DefaultServiceBusPersisterConnection : IServiceBusPersisterConnection { private readonly ILogger _logger; private readonly ServiceBusConnectionStringBuilder _serviceBusConnectionStringBuilder; @@ -16,8 +16,8 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus ILogger logger) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); - - _serviceBusConnectionStringBuilder = serviceBusConnectionStringBuilder ?? + + _serviceBusConnectionStringBuilder = serviceBusConnectionStringBuilder ?? throw new ArgumentNullException(nameof(serviceBusConnectionStringBuilder)); _topicClient = new TopicClient(_serviceBusConnectionStringBuilder, RetryPolicy.Default); } @@ -26,7 +26,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus public ITopicClient CreateModel() { - if(_topicClient.IsClosedOrClosing) + if (_topicClient.IsClosedOrClosing) { _topicClient = new TopicClient(_serviceBusConnectionStringBuilder, RetryPolicy.Default); } diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/EventStateEnum.cs b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/EventStateEnum.cs index 079cf7d7e..731ba17e8 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/EventStateEnum.cs +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/EventStateEnum.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF +namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF { public enum EventStateEnum { diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogContext.cs b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogContext.cs index de8754e03..b51705538 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogContext.cs +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogContext.cs @@ -1,13 +1,10 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -using System; -using System.Collections.Generic; -using System.Text; namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF { public class IntegrationEventLogContext : DbContext - { + { public IntegrationEventLogContext(DbContextOptions options) : base(options) { } @@ -15,7 +12,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF public DbSet IntegrationEventLogs { get; set; } protected override void OnModelCreating(ModelBuilder builder) - { + { builder.Entity(ConfigureIntegrationEventLogEntry); } diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEntry.cs b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEntry.cs index f9cf4a2c1..977dd0547 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEntry.cs +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEntry.cs @@ -1,13 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Text; +using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; using Newtonsoft.Json; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System.Linq; +using System; using System.ComponentModel.DataAnnotations.Schema; -using System.Reflection; -using Microsoft.Extensions.Logging; -using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services; +using System.Linq; namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF { @@ -16,7 +11,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF private IntegrationEventLogEntry() { } public IntegrationEventLogEntry(IntegrationEvent @event, Guid transactionId) { - EventId = @event.Id; + EventId = @event.Id; CreationTime = @event.CreationDate; EventTypeName = @event.GetType().FullName; Content = JsonConvert.SerializeObject(@event); diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IIntegrationEventLogService.cs b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IIntegrationEventLogService.cs index cbf363c83..93fd11143 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IIntegrationEventLogService.cs +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IIntegrationEventLogService.cs @@ -2,8 +2,6 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; using System; using System.Collections.Generic; -using System.Data.Common; -using System.Linq; using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IntegrationEventLogService.cs b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IntegrationEventLogService.cs index 22c5e1fba..12957479b 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IntegrationEventLogService.cs +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Services/IntegrationEventLogService.cs @@ -1,12 +1,7 @@ using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using Microsoft.Extensions.Logging; -using Newtonsoft.Json; using System; -using System.Collections; using System.Collections.Generic; using System.Data.Common; using System.Linq; @@ -15,7 +10,7 @@ using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services { - public class IntegrationEventLogService : IIntegrationEventLogService,IDisposable + public class IntegrationEventLogService : IIntegrationEventLogService, IDisposable { private readonly IntegrationEventLogContext _integrationEventLogContext; private readonly DbConnection _dbConnection; @@ -43,11 +38,12 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Servi var result = await _integrationEventLogContext.IntegrationEventLogs .Where(e => e.TransactionId == tid && e.State == EventStateEnum.NotPublished).ToListAsync(); - if(result != null && result.Any()){ + if (result != null && result.Any()) + { return result.OrderBy(o => o.CreationTime) - .Select(e => e.DeserializeJsonContent(_eventTypes.Find(t=> t.Name == e.EventTypeShortName))); + .Select(e => e.DeserializeJsonContent(_eventTypes.Find(t => t.Name == e.EventTypeShortName))); } - + return new List(); } @@ -83,7 +79,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Servi var eventLogEntry = _integrationEventLogContext.IntegrationEventLogs.Single(ie => ie.EventId == eventId); eventLogEntry.State = status; - if(status == EventStateEnum.InProgress) + if (status == EventStateEnum.InProgress) eventLogEntry.TimesSent++; _integrationEventLogContext.IntegrationEventLogs.Update(eventLogEntry); @@ -100,7 +96,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Servi _integrationEventLogContext?.Dispose(); } - + disposedValue = true; } } diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Utilities/ResilientTransaction.cs b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Utilities/ResilientTransaction.cs index f8227882b..8dbb070d3 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Utilities/ResilientTransaction.cs +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/Utilities/ResilientTransaction.cs @@ -1,11 +1,5 @@ using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services; using System; -using System.Collections.Generic; -using System.Data.Common; -using System.Text; using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Utilities @@ -16,8 +10,8 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Utili private ResilientTransaction(DbContext context) => _context = context ?? throw new ArgumentNullException(nameof(context)); - public static ResilientTransaction New (DbContext context) => - new ResilientTransaction(context); + public static ResilientTransaction New(DbContext context) => + new ResilientTransaction(context); public async Task ExecuteAsync(Func action) { diff --git a/src/Services/Basket/Basket.API/Auth/Server/AuthorizationHeaderParameterOperationFilter.cs b/src/Services/Basket/Basket.API/Auth/Server/AuthorizationHeaderParameterOperationFilter.cs index 7fe19bae3..3d505b4ee 100644 --- a/src/Services/Basket/Basket.API/Auth/Server/AuthorizationHeaderParameterOperationFilter.cs +++ b/src/Services/Basket/Basket.API/Auth/Server/AuthorizationHeaderParameterOperationFilter.cs @@ -1,6 +1,5 @@ using Microsoft.AspNetCore.Mvc.Authorization; using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.SwaggerGen; using System.Collections.Generic; using System.Linq; diff --git a/src/Services/Basket/Basket.API/Controllers/BasketController.cs b/src/Services/Basket/Basket.API/Controllers/BasketController.cs index 9864e21e8..0a3b5879b 100644 --- a/src/Services/Basket/Basket.API/Controllers/BasketController.cs +++ b/src/Services/Basket/Basket.API/Controllers/BasketController.cs @@ -7,7 +7,6 @@ using Microsoft.eShopOnContainers.Services.Basket.API.Model; using Microsoft.eShopOnContainers.Services.Basket.API.Services; using Microsoft.Extensions.Logging; using System; -using System.Linq; using System.Net; using System.Security.Claims; using System.Threading.Tasks; @@ -47,7 +46,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers [HttpPost] [ProducesResponseType(typeof(CustomerBasket), (int)HttpStatusCode.OK)] - public async Task> UpdateBasketAsync([FromBody]CustomerBasket value) + public async Task> UpdateBasketAsync([FromBody] CustomerBasket value) { return Ok(await _repository.UpdateBasketAsync(value)); } @@ -56,7 +55,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers [HttpPost] [ProducesResponseType((int)HttpStatusCode.Accepted)] [ProducesResponseType((int)HttpStatusCode.BadRequest)] - public async Task CheckoutAsync([FromBody]BasketCheckout basketCheckout, [FromHeader(Name = "x-requestid")] string requestId) + public async Task CheckoutAsync([FromBody] BasketCheckout basketCheckout, [FromHeader(Name = "x-requestid")] string requestId) { var userId = _identityService.GetUserIdentity(); diff --git a/src/Services/Basket/Basket.API/Grpc/BasketService.cs b/src/Services/Basket/Basket.API/Grpc/BasketService.cs index 830703b59..51633b326 100644 --- a/src/Services/Basket/Basket.API/Grpc/BasketService.cs +++ b/src/Services/Basket/Basket.API/Grpc/BasketService.cs @@ -4,7 +4,6 @@ using Microsoft.eShopOnContainers.Services.Basket.API.Model; using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; -using GrpcBasket; namespace GrpcBasket { diff --git a/src/Services/Basket/Basket.API/Infrastructure/Middlewares/FailingMiddleware.cs b/src/Services/Basket/Basket.API/Infrastructure/Middlewares/FailingMiddleware.cs index 108955bd4..69578f82d 100644 --- a/src/Services/Basket/Basket.API/Infrastructure/Middlewares/FailingMiddleware.cs +++ b/src/Services/Basket/Basket.API/Infrastructure/Middlewares/FailingMiddleware.cs @@ -44,7 +44,7 @@ namespace Basket.API.Infrastructure.Middlewares private async Task ProcessConfigRequest(HttpContext context) { var enable = context.Request.Query.Keys.Any(k => k == "enable"); - var disable = context.Request.Query.Keys.Any(k => k == "disable"); + var disable = context.Request.Query.Keys.Any(k => k == "disable"); if (enable && disable) { @@ -86,7 +86,7 @@ namespace Basket.API.Infrastructure.Middlewares } return _mustFail && - (_options.EndpointPaths.Any(x => x == rpath) + (_options.EndpointPaths.Any(x => x == rpath) || _options.EndpointPaths.Count == 0); } } diff --git a/src/Services/Basket/Basket.API/Infrastructure/Middlewares/FailingOptions.cs b/src/Services/Basket/Basket.API/Infrastructure/Middlewares/FailingOptions.cs index 63e1e5525..e8a77f1fd 100644 --- a/src/Services/Basket/Basket.API/Infrastructure/Middlewares/FailingOptions.cs +++ b/src/Services/Basket/Basket.API/Infrastructure/Middlewares/FailingOptions.cs @@ -7,6 +7,6 @@ namespace Basket.API.Infrastructure.Middlewares public string ConfigPath = "/Failing"; public List EndpointPaths { get; set; } = new List(); - public List NotFilteredPaths {get; set;} = new List(); + public List NotFilteredPaths { get; set; } = new List(); } } diff --git a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/OrderStartedIntegrationEventHandler.cs b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/OrderStartedIntegrationEventHandler.cs index cb7b6a2d6..fb2c10e9e 100644 --- a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/OrderStartedIntegrationEventHandler.cs +++ b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/OrderStartedIntegrationEventHandler.cs @@ -1,6 +1,5 @@ using Basket.API.IntegrationEvents.Events; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; -using Microsoft.eShopOnContainers.Services.Basket.API; using Microsoft.eShopOnContainers.Services.Basket.API.Model; using Microsoft.Extensions.Logging; using Serilog.Context; diff --git a/src/Services/Basket/Basket.API/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs b/src/Services/Basket/Basket.API/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs index cb4a63f32..e0567b54e 100644 --- a/src/Services/Basket/Basket.API/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs +++ b/src/Services/Basket/Basket.API/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs @@ -10,6 +10,6 @@ namespace Basket.API.IntegrationEvents.Events public string UserId { get; init; } public OrderStartedIntegrationEvent(string userId) - => UserId = userId; + => UserId = userId; } } diff --git a/src/Services/Basket/Basket.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs b/src/Services/Basket/Basket.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs index a06947b65..c69fe0f72 100644 --- a/src/Services/Basket/Basket.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs +++ b/src/Services/Basket/Basket.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs @@ -6,7 +6,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Even // An Event is “something that has happened in the past”, therefore its name has to be // An Integration Event is an event that can cause side effects to other microsrvices, Bounded-Contexts or external systems. public record ProductPriceChangedIntegrationEvent : IntegrationEvent - { + { public int ProductId { get; private init; } public decimal NewPrice { get; private init; } diff --git a/src/Services/Basket/Basket.API/Model/BasketItem.cs b/src/Services/Basket/Basket.API/Model/BasketItem.cs index 4d2e4f331..f781d5a60 100644 --- a/src/Services/Basket/Basket.API/Model/BasketItem.cs +++ b/src/Services/Basket/Basket.API/Model/BasketItem.cs @@ -18,7 +18,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Model if (Quantity < 1) { - results.Add(new ValidationResult("Invalid number of units", new []{ "Quantity" })); + results.Add(new ValidationResult("Invalid number of units", new[] { "Quantity" })); } return results; diff --git a/src/Services/Basket/Basket.API/Program.cs b/src/Services/Basket/Basket.API/Program.cs index ef36cddfe..058735a07 100644 --- a/src/Services/Basket/Basket.API/Program.cs +++ b/src/Services/Basket/Basket.API/Program.cs @@ -104,7 +104,8 @@ IConfiguration GetConfiguration() return (port, grpcPort); } -public class Program { +public class Program +{ public static string Namespace = typeof(Startup).Namespace; public static string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1); diff --git a/src/Services/Basket/Basket.API/Services/IdentityService.cs b/src/Services/Basket/Basket.API/Services/IdentityService.cs index d187be8d6..bc6b2faf4 100644 --- a/src/Services/Basket/Basket.API/Services/IdentityService.cs +++ b/src/Services/Basket/Basket.API/Services/IdentityService.cs @@ -6,7 +6,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Services { public class IdentityService : IIdentityService { - private IHttpContextAccessor _context; + private IHttpContextAccessor _context; public IdentityService(IHttpContextAccessor context) { diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs index 7b4d6b96b..daa4e8342 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -1,9 +1,9 @@ using Autofac; using Autofac.Extensions.DependencyInjection; using Basket.API.Infrastructure.Filters; -using Basket.API.Infrastructure.Middlewares; using Basket.API.IntegrationEvents.EventHandling; using Basket.API.IntegrationEvents.Events; +using GrpcBasket; using HealthChecks.UI.Client; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; @@ -33,9 +33,6 @@ using System; using System.Collections.Generic; using System.IdentityModel.Tokens.Jwt; using System.IO; -using GrpcBasket; -using Microsoft.AspNetCore.Http.Features; -using Serilog; namespace Microsoft.eShopOnContainers.Services.Basket.API { @@ -213,7 +210,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API ConfigureAuth(app); app.UseStaticFiles(); - + app.UseEndpoints(endpoints => { endpoints.MapGrpcService(); @@ -255,22 +252,22 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API private void ConfigureAuthService(IServiceCollection services) { - // prevent from mapping "sub" claim to nameidentifier. - JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Remove("sub"); - - var identityUrl = Configuration.GetValue("IdentityUrl"); - - services.AddAuthentication(options => - { - options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; - options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; - - }).AddJwtBearer(options => - { - options.Authority = identityUrl; - options.RequireHttpsMetadata = false; - options.Audience = "basket"; - }); + // prevent from mapping "sub" claim to nameidentifier. + JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Remove("sub"); + + var identityUrl = Configuration.GetValue("IdentityUrl"); + + services.AddAuthentication(options => + { + options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; + options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; + + }).AddJwtBearer(options => + { + options.Authority = identityUrl; + options.RequireHttpsMetadata = false; + options.Audience = "basket"; + }); } protected virtual void ConfigureAuth(IApplicationBuilder app) diff --git a/src/Services/Basket/Basket.FunctionalTests/Base/BasketTestStartup.cs b/src/Services/Basket/Basket.FunctionalTests/Base/BasketTestStartup.cs index cb8ec8641..d0237407d 100644 --- a/src/Services/Basket/Basket.FunctionalTests/Base/BasketTestStartup.cs +++ b/src/Services/Basket/Basket.FunctionalTests/Base/BasketTestStartup.cs @@ -1,9 +1,9 @@ -using System; -using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Routing; using Microsoft.eShopOnContainers.Services.Basket.API; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using System; namespace Basket.FunctionalTests.Base { @@ -20,7 +20,7 @@ namespace Basket.FunctionalTests.Base services.Configure(Configuration); return base.ConfigureServices(services); } - + protected override void ConfigureAuth(IApplicationBuilder app) { if (Configuration["isTest"] == bool.TrueString.ToLowerInvariant()) diff --git a/src/Services/Basket/Basket.FunctionalTests/BasketScenarios.cs b/src/Services/Basket/Basket.FunctionalTests/BasketScenarios.cs index c5eacfa4e..6928d5cd2 100644 --- a/src/Services/Basket/Basket.FunctionalTests/BasketScenarios.cs +++ b/src/Services/Basket/Basket.FunctionalTests/BasketScenarios.cs @@ -73,7 +73,7 @@ namespace Basket.FunctionalTests string BuildCheckout() { - var checkoutBasket = new + var checkoutBasket = new { City = "city", Street = "street", diff --git a/src/Services/Basket/Basket.FunctionalTests/RedisBasketRepositoryTests.cs b/src/Services/Basket/Basket.FunctionalTests/RedisBasketRepositoryTests.cs index 67931c443..a13c1f6a2 100644 --- a/src/Services/Basket/Basket.FunctionalTests/RedisBasketRepositoryTests.cs +++ b/src/Services/Basket/Basket.FunctionalTests/RedisBasketRepositoryTests.cs @@ -33,7 +33,7 @@ namespace Basket.FunctionalTests Assert.Single(basket.Items); } - + } [Fact] @@ -58,7 +58,7 @@ namespace Basket.FunctionalTests Assert.True(deleteResult); Assert.Null(result); - } + } } RedisBasketRepository BuildBasketRepository(ConnectionMultiplexer connMux) diff --git a/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs b/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs index 5dfb10a96..d58c06f66 100644 --- a/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs +++ b/src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs @@ -37,7 +37,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers [ProducesResponseType(typeof(PaginatedItemsViewModel), (int)HttpStatusCode.OK)] [ProducesResponseType(typeof(IEnumerable), (int)HttpStatusCode.OK)] [ProducesResponseType((int)HttpStatusCode.BadRequest)] - public async Task ItemsAsync([FromQuery]int pageSize = 10, [FromQuery]int pageIndex = 0, string ids = null) + public async Task ItemsAsync([FromQuery] int pageSize = 10, [FromQuery] int pageIndex = 0, string ids = null) { if (!string.IsNullOrEmpty(ids)) { @@ -126,7 +126,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers [HttpGet] [Route("items/withname/{name:minlength(1)}")] [ProducesResponseType(typeof(PaginatedItemsViewModel), (int)HttpStatusCode.OK)] - public async Task>> ItemsWithNameAsync(string name, [FromQuery]int pageSize = 10, [FromQuery]int pageIndex = 0) + public async Task>> ItemsWithNameAsync(string name, [FromQuery] int pageSize = 10, [FromQuery] int pageIndex = 0) { var totalItems = await _catalogContext.CatalogItems .Where(c => c.Name.StartsWith(name)) @@ -147,7 +147,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers [HttpGet] [Route("items/type/{catalogTypeId}/brand/{catalogBrandId:int?}")] [ProducesResponseType(typeof(PaginatedItemsViewModel), (int)HttpStatusCode.OK)] - public async Task>> ItemsByTypeIdAndBrandIdAsync(int catalogTypeId, int? catalogBrandId, [FromQuery]int pageSize = 10, [FromQuery]int pageIndex = 0) + public async Task>> ItemsByTypeIdAndBrandIdAsync(int catalogTypeId, int? catalogBrandId, [FromQuery] int pageSize = 10, [FromQuery] int pageIndex = 0) { var root = (IQueryable)_catalogContext.CatalogItems; @@ -175,7 +175,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers [HttpGet] [Route("items/type/all/brand/{catalogBrandId:int?}")] [ProducesResponseType(typeof(PaginatedItemsViewModel), (int)HttpStatusCode.OK)] - public async Task>> ItemsByBrandIdAsync(int? catalogBrandId, [FromQuery]int pageSize = 10, [FromQuery]int pageIndex = 0) + public async Task>> ItemsByBrandIdAsync(int? catalogBrandId, [FromQuery] int pageSize = 10, [FromQuery] int pageIndex = 0) { var root = (IQueryable)_catalogContext.CatalogItems; @@ -220,7 +220,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers [HttpPut] [ProducesResponseType((int)HttpStatusCode.NotFound)] [ProducesResponseType((int)HttpStatusCode.Created)] - public async Task UpdateProductAsync([FromBody]CatalogItem productToUpdate) + public async Task UpdateProductAsync([FromBody] CatalogItem productToUpdate) { var catalogItem = await _catalogContext.CatalogItems.SingleOrDefaultAsync(i => i.Id == productToUpdate.Id); @@ -259,7 +259,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers [Route("items")] [HttpPost] [ProducesResponseType((int)HttpStatusCode.Created)] - public async Task CreateProductAsync([FromBody]CatalogItem product) + public async Task CreateProductAsync([FromBody] CatalogItem product) { var item = new CatalogItem { diff --git a/src/Services/Catalog/Catalog.API/Extensions/CatalogItemExtensions.cs b/src/Services/Catalog/Catalog.API/Extensions/CatalogItemExtensions.cs index fa2c3f60e..e953df581 100644 --- a/src/Services/Catalog/Catalog.API/Extensions/CatalogItemExtensions.cs +++ b/src/Services/Catalog/Catalog.API/Extensions/CatalogItemExtensions.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Microsoft.eShopOnContainers.Services.Catalog.API.Model +namespace Microsoft.eShopOnContainers.Services.Catalog.API.Model { public static class CatalogItemExtensions { diff --git a/src/Services/Catalog/Catalog.API/Extensions/HostExtensions.cs b/src/Services/Catalog/Catalog.API/Extensions/HostExtensions.cs index cfa7e9d2f..ccdd73558 100644 --- a/src/Services/Catalog/Catalog.API/Extensions/HostExtensions.cs +++ b/src/Services/Catalog/Catalog.API/Extensions/HostExtensions.cs @@ -1,13 +1,10 @@ using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Hosting; -using System; using Microsoft.Extensions.DependencyInjection; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Polly; +using System; using System.Data.SqlClient; namespace Catalog.API.Extensions diff --git a/src/Services/Catalog/Catalog.API/Extensions/WebHostExtensions.cs b/src/Services/Catalog/Catalog.API/Extensions/WebHostExtensions.cs index b7a982b2e..07fc11770 100644 --- a/src/Services/Catalog/Catalog.API/Extensions/WebHostExtensions.cs +++ b/src/Services/Catalog/Catalog.API/Extensions/WebHostExtensions.cs @@ -1,11 +1,11 @@ -using Microsoft.EntityFrameworkCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; -using System; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Polly; +using System; using System.Data.SqlClient; -using Microsoft.AspNetCore.Hosting; namespace Catalog.API.Extensions { diff --git a/src/Services/Catalog/Catalog.API/Grpc/CatalogService.cs b/src/Services/Catalog/Catalog.API/Grpc/CatalogService.cs index ef22b5be2..e502780ee 100644 --- a/src/Services/Catalog/Catalog.API/Grpc/CatalogService.cs +++ b/src/Services/Catalog/Catalog.API/Grpc/CatalogService.cs @@ -1,16 +1,15 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using CatalogApi; +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.eShopOnContainers.Services.Catalog.API.ViewModel; 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 diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs index 8cff66b08..ee440c1ef 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs @@ -1,9 +1,9 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure { - using Microsoft.EntityFrameworkCore; using EntityConfigurations; - using Model; + using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; + using Model; public class CatalogContext : DbContext { @@ -19,7 +19,7 @@ builder.ApplyConfiguration(new CatalogBrandEntityTypeConfiguration()); builder.ApplyConfiguration(new CatalogTypeEntityTypeConfiguration()); builder.ApplyConfiguration(new CatalogItemEntityTypeConfiguration()); - } + } } @@ -27,7 +27,7 @@ { public CatalogContext CreateDbContext(string[] args) { - var optionsBuilder = new DbContextOptionsBuilder() + var optionsBuilder = new DbContextOptionsBuilder() .UseSqlServer("Server=.;Initial Catalog=Microsoft.eShopOnContainers.Services.CatalogDb;Integrated Security=true"); return new CatalogContext(optionsBuilder.Options); diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContextSeed.cs b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContextSeed.cs index e425072e0..5416b377a 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContextSeed.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContextSeed.cs @@ -19,7 +19,7 @@ public class CatalogContextSeed { - public async Task SeedAsync(CatalogContext context,IWebHostEnvironment env,IOptions settings,ILogger logger) + public async Task SeedAsync(CatalogContext context, IWebHostEnvironment env, IOptions settings, ILogger logger) { var policy = CreatePolicy(logger, nameof(CatalogContextSeed)); @@ -73,7 +73,7 @@ try { string[] requiredHeaders = { "catalogbrand" }; - csvheaders = GetHeaders( csvFileCatalogBrands, requiredHeaders ); + csvheaders = GetHeaders(csvFileCatalogBrands, requiredHeaders); } catch (Exception ex) { @@ -128,7 +128,7 @@ try { string[] requiredHeaders = { "catalogtype" }; - csvheaders = GetHeaders( csvFileCatalogTypes, requiredHeaders ); + csvheaders = GetHeaders(csvFileCatalogTypes, requiredHeaders); } catch (Exception ex) { @@ -183,7 +183,7 @@ { string[] requiredHeaders = { "catalogtypename", "catalogbrandname", "description", "name", "price", "picturefilename" }; string[] optionalheaders = { "availablestock", "restockthreshold", "maxstockthreshold", "onreorder" }; - csvheaders = GetHeaders(csvFileCatalogItems, requiredHeaders, optionalheaders ); + csvheaders = GetHeaders(csvFileCatalogItems, requiredHeaders, optionalheaders); } catch (Exception ex) { @@ -196,7 +196,7 @@ return File.ReadAllLines(csvFileCatalogItems) .Skip(1) // skip header row - .Select(row => Regex.Split(row, ",(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)") ) + .Select(row => Regex.Split(row, ",(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)")) .SelectTry(column => CreateCatalogItem(column, csvheaders, catalogTypeIdLookup, catalogBrandIdLookup)) .OnCaughtException(ex => { logger.LogError(ex, "EXCEPTION ERROR: {Message}", ex.Message); return null; }) .Where(x => x != null); @@ -243,7 +243,7 @@ string availableStockString = column[availableStockIndex].Trim('"').Trim(); if (!String.IsNullOrEmpty(availableStockString)) { - if ( int.TryParse(availableStockString, out int availableStock)) + if (int.TryParse(availableStockString, out int availableStock)) { catalogItem.AvailableStock = availableStock; } @@ -370,7 +370,7 @@ } } - private AsyncRetryPolicy CreatePolicy( ILogger logger, string prefix,int retries = 3) + private AsyncRetryPolicy CreatePolicy(ILogger logger, string prefix, int retries = 3) { return Policy.Handle(). WaitAndRetryAsync( diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20161103152832_Initial.cs b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20161103152832_Initial.cs index 51c7dfafb..9df75e024 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20161103152832_Initial.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20161103152832_Initial.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Catalog.API.Infrastructure.Migrations { diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20161103153420_UpdateTableNames.cs b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20161103153420_UpdateTableNames.cs index dd73fbcd9..9c266c9db 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20161103153420_UpdateTableNames.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20161103153420_UpdateTableNames.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Catalog.API.Infrastructure.Migrations { diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170314083211_AddEventTable.cs b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170314083211_AddEventTable.cs index e6494d2a3..953797a75 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170314083211_AddEventTable.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170314083211_AddEventTable.cs @@ -1,6 +1,5 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; +using System; namespace Catalog.API.Infrastructure.Migrations { diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170316012921_RefactoringToIntegrationEventLog.cs b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170316012921_RefactoringToIntegrationEventLog.cs index 17c4b2bbc..a6c69efa3 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170316012921_RefactoringToIntegrationEventLog.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170316012921_RefactoringToIntegrationEventLog.cs @@ -1,6 +1,5 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; +using System; namespace Catalog.API.Infrastructure.Migrations { diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170316120022_RefactoringEventBusNamespaces.cs b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170316120022_RefactoringEventBusNamespaces.cs index ff012cd60..019aab01d 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170316120022_RefactoringEventBusNamespaces.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170316120022_RefactoringEventBusNamespaces.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Catalog.API.Infrastructure.Migrations { diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170322124244_RemoveIntegrationEventLogs.cs b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170322124244_RemoveIntegrationEventLogs.cs index 88e0c76db..392580d00 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170322124244_RemoveIntegrationEventLogs.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170322124244_RemoveIntegrationEventLogs.cs @@ -1,6 +1,5 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; +using System; namespace Catalog.API.Infrastructure.Migrations { diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170509130025_AddStockProductItem.cs b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170509130025_AddStockProductItem.cs index ede85cb4e..fcfbac64a 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170509130025_AddStockProductItem.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170509130025_AddStockProductItem.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Catalog.API.Infrastructure.Migrations { diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170530133114_AddPictureFileName.cs b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170530133114_AddPictureFileName.cs index fc7f4dc8d..29c10e970 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170530133114_AddPictureFileName.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/20170530133114_AddPictureFileName.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Catalog.API.Infrastructure.Migrations { diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/CatalogContextModelSnapshot.cs b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/CatalogContextModelSnapshot.cs index 7b72f3388..455e87ec9 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/CatalogContextModelSnapshot.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogMigrations/CatalogContextModelSnapshot.cs @@ -1,8 +1,6 @@ -using System; -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure; namespace Catalog.API.Infrastructure.Migrations diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/IntegrationEventMigrations/20170322145434_IntegrationEventInitial.cs b/src/Services/Catalog/Catalog.API/Infrastructure/IntegrationEventMigrations/20170322145434_IntegrationEventInitial.cs index fff1ad04c..5f7ea0c73 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/IntegrationEventMigrations/20170322145434_IntegrationEventInitial.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/IntegrationEventMigrations/20170322145434_IntegrationEventInitial.cs @@ -1,6 +1,5 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; +using System; namespace Catalog.API.Migrations { diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs index 3e7ba9868..1ed2783df 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs @@ -1,20 +1,17 @@ using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; 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; using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure; using Microsoft.Extensions.Logging; -using Serilog.Context; using System; using System.Data.Common; using System.Threading.Tasks; namespace Catalog.API.IntegrationEvents { - public class CatalogIntegrationEventService : ICatalogIntegrationEventService,IDisposable + public class CatalogIntegrationEventService : ICatalogIntegrationEventService, IDisposable { private readonly Func _integrationEventLogServiceFactory; private readonly IEventBus _eventBus; @@ -75,7 +72,7 @@ namespace Catalog.API.IntegrationEvents { (_eventLogService as IDisposable)?.Dispose(); } - + disposedValue = true; } } diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs index 493a271cc..95da93f75 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs @@ -1,17 +1,17 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.EventHandling { using BuildingBlocks.EventBus.Abstractions; - using System.Threading.Tasks; using BuildingBlocks.EventBus.Events; - using Infrastructure; - using System.Collections.Generic; - using System.Linq; using global::Catalog.API.IntegrationEvents; + using Infrastructure; using IntegrationEvents.Events; - using Serilog.Context; using Microsoft.Extensions.Logging; + using Serilog.Context; + using System.Collections.Generic; + using System.Linq; + using System.Threading.Tasks; - public class OrderStatusChangedToAwaitingValidationIntegrationEventHandler : + public class OrderStatusChangedToAwaitingValidationIntegrationEventHandler : IIntegrationEventHandler { private readonly CatalogContext _catalogContext; diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs index 7d383254f..5a9b4a0f8 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs @@ -1,13 +1,13 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.EventHandling { using BuildingBlocks.EventBus.Abstractions; - using System.Threading.Tasks; using Infrastructure; using Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.Events; using Microsoft.Extensions.Logging; using Serilog.Context; + using System.Threading.Tasks; - public class OrderStatusChangedToPaidIntegrationEventHandler : + public class OrderStatusChangedToPaidIntegrationEventHandler : IIntegrationEventHandler { private readonly CatalogContext _catalogContext; diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs index d5a295cc5..b89465f7a 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs @@ -1,7 +1,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.Events { - using System.Collections.Generic; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; + using System.Collections.Generic; public record OrderStatusChangedToPaidIntegrationEvent : IntegrationEvent { diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs index 004c938a1..9f1f504af 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs @@ -6,7 +6,7 @@ // 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. public record ProductPriceChangedIntegrationEvent : IntegrationEvent - { + { public int ProductId { get; private init; } public decimal NewPrice { get; private init; } diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index 836b6a7b8..5747f83b4 100644 --- a/src/Services/Catalog/Catalog.API/Startup.cs +++ b/src/Services/Catalog/Catalog.API/Startup.cs @@ -11,7 +11,6 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Azure.ServiceBus; using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ; @@ -82,7 +81,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API { c.SwaggerEndpoint($"{ (!string.IsNullOrEmpty(pathBase) ? pathBase : string.Empty) }/swagger/v1/swagger.json", "Catalog.API V1"); }); - + app.UseRouting(); app.UseCors("CorsPolicy"); app.UseEndpoints(endpoints => diff --git a/src/Services/Catalog/Catalog.FunctionalTests/CatalogScenarioBase.cs b/src/Services/Catalog/Catalog.FunctionalTests/CatalogScenarioBase.cs index 6a8cbd72f..8545d14aa 100644 --- a/src/Services/Catalog/Catalog.FunctionalTests/CatalogScenarioBase.cs +++ b/src/Services/Catalog/Catalog.FunctionalTests/CatalogScenarioBase.cs @@ -1,4 +1,3 @@ -using Autofac.Extensions.DependencyInjection; using Catalog.API.Extensions; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; diff --git a/src/Services/Identity/Identity.API/Controllers/AccountController.cs b/src/Services/Identity/Identity.API/Controllers/AccountController.cs index ccb19a66d..fd041cf7b 100644 --- a/src/Services/Identity/Identity.API/Controllers/AccountController.cs +++ b/src/Services/Identity/Identity.API/Controllers/AccountController.cs @@ -1,9 +1,4 @@ -using System; -using System.Linq; -using System.Security.Claims; -using System.Text.Encodings.Web; -using System.Threading.Tasks; -using IdentityModel; +using IdentityModel; using IdentityServer4; using IdentityServer4.Models; using IdentityServer4.Services; @@ -17,6 +12,10 @@ using Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels using Microsoft.eShopOnContainers.Services.Identity.API.Services; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; +using System; +using System.Linq; +using System.Security.Claims; +using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Services.Identity.API.Controllers { diff --git a/src/Services/Identity/Identity.API/Controllers/ConsentController.cs b/src/Services/Identity/Identity.API/Controllers/ConsentController.cs index 095440d6b..b8a11fb1c 100644 --- a/src/Services/Identity/Identity.API/Controllers/ConsentController.cs +++ b/src/Services/Identity/Identity.API/Controllers/ConsentController.cs @@ -19,7 +19,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Controllers private readonly IResourceStore _resourceStore; private readonly IIdentityServerInteractionService _interaction; - + public ConsentController( ILogger logger, IIdentityServerInteractionService interaction, diff --git a/src/Services/Identity/Identity.API/Controllers/HomeController.cs b/src/Services/Identity/Identity.API/Controllers/HomeController.cs index 66931b764..30edd16b3 100644 --- a/src/Services/Identity/Identity.API/Controllers/HomeController.cs +++ b/src/Services/Identity/Identity.API/Controllers/HomeController.cs @@ -14,7 +14,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Controllers private readonly IOptionsSnapshot _settings; private readonly IRedirectService _redirectSvc; - public HomeController(IIdentityServerInteractionService interaction, IOptionsSnapshot settings,IRedirectService redirectSvc) + public HomeController(IIdentityServerInteractionService interaction, IOptionsSnapshot settings, IRedirectService redirectSvc) { _interaction = interaction; _settings = settings; diff --git a/src/Services/Identity/Identity.API/Data/ApplicationDbContextSeed.cs b/src/Services/Identity/Identity.API/Data/ApplicationDbContextSeed.cs index ba6677563..b80f506a9 100644 --- a/src/Services/Identity/Identity.API/Data/ApplicationDbContextSeed.cs +++ b/src/Services/Identity/Identity.API/Data/ApplicationDbContextSeed.cs @@ -20,8 +20,8 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Data { private readonly IPasswordHasher _passwordHasher = new PasswordHasher(); - public async Task SeedAsync(ApplicationDbContext context,IWebHostEnvironment env, - ILogger logger, IOptions settings,int? retry = 0) + public async Task SeedAsync(ApplicationDbContext context, IWebHostEnvironment env, + ILogger logger, IOptions settings, int? retry = 0) { int retryForAvaiability = retry.Value; @@ -50,10 +50,10 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Data if (retryForAvaiability < 10) { retryForAvaiability++; - + logger.LogError(ex, "EXCEPTION ERROR while migrating {DbContextName}", nameof(ApplicationDbContext)); - await SeedAsync(context,env,logger,settings, retryForAvaiability); + await SeedAsync(context, env, logger, settings, retryForAvaiability); } } } @@ -87,7 +87,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Data List users = File.ReadAllLines(csvFileUsers) .Skip(1) // skip header column - .Select(row => Regex.Split(row, ",(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)") ) + .Select(row => Regex.Split(row, ",(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)")) .SelectTry(column => CreateApplicationUser(column, csvheaders)) .OnCaughtException(ex => { logger.LogError(ex, "EXCEPTION ERROR: {Message}", ex.Message); return null; }) .Where(x => x != null) diff --git a/src/Services/Identity/Identity.API/Data/ConfigurationDbContextSeed.cs b/src/Services/Identity/Identity.API/Data/ConfigurationDbContextSeed.cs index dd8ed9bd2..6c49106bb 100644 --- a/src/Services/Identity/Identity.API/Data/ConfigurationDbContextSeed.cs +++ b/src/Services/Identity/Identity.API/Data/ConfigurationDbContextSeed.cs @@ -4,7 +4,6 @@ using IdentityServer4.EntityFramework.Mappers; using Microsoft.EntityFrameworkCore; using Microsoft.eShopOnContainers.Services.Identity.API.Configuration; using Microsoft.Extensions.Configuration; -using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -13,9 +12,9 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Data { public class ConfigurationDbContextSeed { - public async Task SeedAsync(ConfigurationDbContext context,IConfiguration configuration) + public async Task SeedAsync(ConfigurationDbContext context, IConfiguration configuration) { - + //callbacks urls from config: var clientUrls = new Dictionary(); diff --git a/src/Services/Identity/Identity.API/Devspaces/IdentityDevspacesBuilderExtensions.cs b/src/Services/Identity/Identity.API/Devspaces/IdentityDevspacesBuilderExtensions.cs index 4dadb0e54..5294177c7 100644 --- a/src/Services/Identity/Identity.API/Devspaces/IdentityDevspacesBuilderExtensions.cs +++ b/src/Services/Identity/Identity.API/Devspaces/IdentityDevspacesBuilderExtensions.cs @@ -1,8 +1,4 @@ using Microsoft.Extensions.DependencyInjection; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Services.Identity.API.Devspaces { diff --git a/src/Services/Identity/Identity.API/Migrations/20190729091724_InitialMigration.cs b/src/Services/Identity/Identity.API/Migrations/20190729091724_InitialMigration.cs index 447369dd0..58c80842b 100644 --- a/src/Services/Identity/Identity.API/Migrations/20190729091724_InitialMigration.cs +++ b/src/Services/Identity/Identity.API/Migrations/20190729091724_InitialMigration.cs @@ -1,6 +1,6 @@ -using System; -using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; +using System; namespace Identity.API.Migrations { diff --git a/src/Services/Identity/Identity.API/Migrations/ConfigurationDb/20190729092011_InitialConfigurationMigration.cs b/src/Services/Identity/Identity.API/Migrations/ConfigurationDb/20190729092011_InitialConfigurationMigration.cs index 05155a83c..8eb69adad 100644 --- a/src/Services/Identity/Identity.API/Migrations/ConfigurationDb/20190729092011_InitialConfigurationMigration.cs +++ b/src/Services/Identity/Identity.API/Migrations/ConfigurationDb/20190729092011_InitialConfigurationMigration.cs @@ -1,6 +1,6 @@ -using System; -using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; +using System; namespace Identity.API.Migrations.ConfigurationDb { diff --git a/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/20190729092100_InitialPersistedGrantMigration.cs b/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/20190729092100_InitialPersistedGrantMigration.cs index 076f12323..ac19250a6 100644 --- a/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/20190729092100_InitialPersistedGrantMigration.cs +++ b/src/Services/Identity/Identity.API/Migrations/PersistedGrantDb/20190729092100_InitialPersistedGrantMigration.cs @@ -1,5 +1,5 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; +using System; namespace Identity.API.Migrations.PersistedGrantDb { diff --git a/src/Services/Identity/Identity.API/Models/AccountViewModels/ConsentViewModel.cs b/src/Services/Identity/Identity.API/Models/AccountViewModels/ConsentViewModel.cs index 10dc8548a..07dbd05c3 100644 --- a/src/Services/Identity/Identity.API/Models/AccountViewModels/ConsentViewModel.cs +++ b/src/Services/Identity/Identity.API/Models/AccountViewModels/ConsentViewModel.cs @@ -1,6 +1,6 @@ -using System.Collections.Generic; +using IdentityServer4.Models; +using System.Collections.Generic; using System.Linq; -using IdentityServer4.Models; namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels { diff --git a/src/Services/Identity/Identity.API/Services/EFLoginService.cs b/src/Services/Identity/Identity.API/Services/EFLoginService.cs index f3a9d5a03..6cee1e7c8 100644 --- a/src/Services/Identity/Identity.API/Services/EFLoginService.cs +++ b/src/Services/Identity/Identity.API/Services/EFLoginService.cs @@ -1,7 +1,7 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Identity; using Microsoft.eShopOnContainers.Services.Identity.API.Models; +using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Services.Identity.API.Services { diff --git a/src/Services/Identity/Identity.API/Services/ILoginService.cs b/src/Services/Identity/Identity.API/Services/ILoginService.cs index 8a977205b..8b5ba8939 100644 --- a/src/Services/Identity/Identity.API/Services/ILoginService.cs +++ b/src/Services/Identity/Identity.API/Services/ILoginService.cs @@ -1,5 +1,5 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authentication; +using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Services.Identity.API.Services { diff --git a/src/Services/Identity/Identity.API/Services/RedirectService.cs b/src/Services/Identity/Identity.API/Services/RedirectService.cs index bbe0ae976..64a574d78 100644 --- a/src/Services/Identity/Identity.API/Services/RedirectService.cs +++ b/src/Services/Identity/Identity.API/Services/RedirectService.cs @@ -19,7 +19,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Services splitKey = "signin-oidc"; else splitKey = "scope"; - + results = Regex.Split(result, splitKey); if (results.Length < 2) return ""; diff --git a/src/Services/Ordering/Ordering.API/Application/Behaviors/LoggingBehavior.cs b/src/Services/Ordering/Ordering.API/Application/Behaviors/LoggingBehavior.cs index 35023b297..8bcb07b89 100644 --- a/src/Services/Ordering/Ordering.API/Application/Behaviors/LoggingBehavior.cs +++ b/src/Services/Ordering/Ordering.API/Application/Behaviors/LoggingBehavior.cs @@ -1,9 +1,8 @@ using MediatR; +using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; using Microsoft.Extensions.Logging; -using System.Linq; using System.Threading; using System.Threading.Tasks; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; namespace Ordering.API.Application.Behaviors { diff --git a/src/Services/Ordering/Ordering.API/Application/Behaviors/ValidatorBehavior.cs b/src/Services/Ordering/Ordering.API/Application/Behaviors/ValidatorBehavior.cs index 6fc12258b..00d88da5f 100644 --- a/src/Services/Ordering/Ordering.API/Application/Behaviors/ValidatorBehavior.cs +++ b/src/Services/Ordering/Ordering.API/Application/Behaviors/ValidatorBehavior.cs @@ -1,11 +1,11 @@ using FluentValidation; using MediatR; +using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; using Microsoft.Extensions.Logging; using Ordering.Domain.Exceptions; using System.Linq; using System.Threading; using System.Threading.Tasks; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; namespace Ordering.API.Application.Behaviors { diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/CancelOrderCommand.cs b/src/Services/Ordering/Ordering.API/Application/Commands/CancelOrderCommand.cs index 77433f161..408abf2b8 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/CancelOrderCommand.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/CancelOrderCommand.cs @@ -1,9 +1,5 @@ using MediatR; -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.Serialization; -using System.Threading.Tasks; namespace Ordering.API.Application.Commands { diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/CancelOrderCommandHandler.cs b/src/Services/Ordering/Ordering.API/Application/Commands/CancelOrderCommandHandler.cs index 07e10e7b1..11313d9f1 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/CancelOrderCommandHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/CancelOrderCommandHandler.cs @@ -27,7 +27,7 @@ namespace Ordering.API.Application.Commands public async Task Handle(CancelOrderCommand command, CancellationToken cancellationToken) { var orderToUpdate = await _orderRepository.GetAsync(command.OrderNumber); - if(orderToUpdate == null) + if (orderToUpdate == null) { return false; } diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommand.cs b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommand.cs index 21e1037b1..fa7a2f706 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommand.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderCommand.cs @@ -1,10 +1,9 @@ -using System; -using MediatR; -using System.Collections.Generic; -using System.Runtime.Serialization; -using System.Collections; +using MediatR; using Ordering.API.Application.Models; +using System; +using System.Collections.Generic; using System.Linq; +using System.Runtime.Serialization; namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands { diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderDraftCommand.cs b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderDraftCommand.cs index 1d3d52c63..bb3e92378 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderDraftCommand.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderDraftCommand.cs @@ -1,18 +1,12 @@ using MediatR; -using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; using Ordering.API.Application.Models; -using System; using System.Collections.Generic; -using System.Linq; -using System.Runtime.Serialization; -using System.Threading.Tasks; -using static Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands.CreateOrderCommand; namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands { - public class CreateOrderDraftCommand : IRequest + public class CreateOrderDraftCommand : IRequest { - + public string BuyerId { get; private set; } public IEnumerable Items { get; private set; } diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderDraftCommandHandler.cs b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderDraftCommandHandler.cs index e51b39f02..abca17b8c 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderDraftCommandHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/CreateOrderDraftCommandHandler.cs @@ -20,7 +20,7 @@ private readonly IMediator _mediator; // Using DI to inject infrastructure persistence Repositories - public CreateOrderDraftCommandHandler(IMediator mediator, IIdentityService identityService) + public CreateOrderDraftCommandHandler(IMediator mediator, IIdentityService identityService) { _identityService = identityService ?? throw new ArgumentNullException(nameof(identityService)); _mediator = mediator ?? throw new ArgumentNullException(nameof(mediator)); diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/IdentifiedCommandHandler.cs b/src/Services/Ordering/Ordering.API/Application/Commands/IdentifiedCommandHandler.cs index 01c42f109..be94e414c 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/IdentifiedCommandHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/IdentifiedCommandHandler.cs @@ -2,9 +2,7 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency; using Microsoft.Extensions.Logging; -using Ordering.API.Application.Behaviors; using Ordering.API.Application.Commands; -using System; using System.Threading; using System.Threading.Tasks; diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/SetAwaitingValidationOrderStatusCommand.cs b/src/Services/Ordering/Ordering.API/Application/Commands/SetAwaitingValidationOrderStatusCommand.cs index 2007b95c6..980211f87 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/SetAwaitingValidationOrderStatusCommand.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/SetAwaitingValidationOrderStatusCommand.cs @@ -1,9 +1,5 @@ using MediatR; -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.Serialization; -using System.Threading.Tasks; namespace Ordering.API.Application.Commands { diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/SetAwaitingValidationOrderStatusCommandHandler.cs b/src/Services/Ordering/Ordering.API/Application/Commands/SetAwaitingValidationOrderStatusCommandHandler.cs index f329d7c3f..da6969404 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/SetAwaitingValidationOrderStatusCommandHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/SetAwaitingValidationOrderStatusCommandHandler.cs @@ -10,7 +10,7 @@ namespace Ordering.API.Application.Commands { // Regular CommandHandler public class SetAwaitingValidationOrderStatusCommandHandler : IRequestHandler - { + { private readonly IOrderRepository _orderRepository; public SetAwaitingValidationOrderStatusCommandHandler(IOrderRepository orderRepository) @@ -27,7 +27,7 @@ namespace Ordering.API.Application.Commands public async Task Handle(SetAwaitingValidationOrderStatusCommand command, CancellationToken cancellationToken) { var orderToUpdate = await _orderRepository.GetAsync(command.OrderNumber); - if(orderToUpdate == null) + if (orderToUpdate == null) { return false; } diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/SetPaidOrderStatusCommand.cs b/src/Services/Ordering/Ordering.API/Application/Commands/SetPaidOrderStatusCommand.cs index 12bab9ac5..d561ad7f3 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/SetPaidOrderStatusCommand.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/SetPaidOrderStatusCommand.cs @@ -1,9 +1,5 @@ using MediatR; -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.Serialization; -using System.Threading.Tasks; namespace Ordering.API.Application.Commands { diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/SetPaidOrderStatusCommandHandler.cs b/src/Services/Ordering/Ordering.API/Application/Commands/SetPaidOrderStatusCommandHandler.cs index f0400ec16..f4268e9ca 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/SetPaidOrderStatusCommandHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/SetPaidOrderStatusCommandHandler.cs @@ -10,7 +10,7 @@ namespace Ordering.API.Application.Commands { // Regular CommandHandler public class SetPaidOrderStatusCommandHandler : IRequestHandler - { + { private readonly IOrderRepository _orderRepository; public SetPaidOrderStatusCommandHandler(IOrderRepository orderRepository) @@ -30,7 +30,7 @@ namespace Ordering.API.Application.Commands await Task.Delay(10000, cancellationToken); var orderToUpdate = await _orderRepository.GetAsync(command.OrderNumber); - if(orderToUpdate == null) + if (orderToUpdate == null) { return false; } diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/SetStockConfirmedOrderStatusCommand.cs b/src/Services/Ordering/Ordering.API/Application/Commands/SetStockConfirmedOrderStatusCommand.cs index 74f002e21..9e0a40915 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/SetStockConfirmedOrderStatusCommand.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/SetStockConfirmedOrderStatusCommand.cs @@ -1,9 +1,5 @@ using MediatR; -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.Serialization; -using System.Threading.Tasks; namespace Ordering.API.Application.Commands { diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/SetStockConfirmedOrderStatusCommandHandler.cs b/src/Services/Ordering/Ordering.API/Application/Commands/SetStockConfirmedOrderStatusCommandHandler.cs index b76c16ec6..c99daa23a 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/SetStockConfirmedOrderStatusCommandHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/SetStockConfirmedOrderStatusCommandHandler.cs @@ -10,7 +10,7 @@ namespace Ordering.API.Application.Commands { // Regular CommandHandler public class SetStockConfirmedOrderStatusCommandHandler : IRequestHandler - { + { private readonly IOrderRepository _orderRepository; public SetStockConfirmedOrderStatusCommandHandler(IOrderRepository orderRepository) @@ -30,7 +30,7 @@ namespace Ordering.API.Application.Commands await Task.Delay(10000, cancellationToken); var orderToUpdate = await _orderRepository.GetAsync(command.OrderNumber); - if(orderToUpdate == null) + if (orderToUpdate == null) { return false; } diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/SetStockRejectedOrderStatusCommand.cs b/src/Services/Ordering/Ordering.API/Application/Commands/SetStockRejectedOrderStatusCommand.cs index c2293c0aa..cb39c5567 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/SetStockRejectedOrderStatusCommand.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/SetStockRejectedOrderStatusCommand.cs @@ -1,9 +1,6 @@ using MediatR; -using System; using System.Collections.Generic; -using System.Linq; using System.Runtime.Serialization; -using System.Threading.Tasks; namespace Ordering.API.Application.Commands { diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/SetStockRejectedOrderStatusCommandHandler.cs b/src/Services/Ordering/Ordering.API/Application/Commands/SetStockRejectedOrderStatusCommandHandler.cs index 98d8dfd77..551b2744d 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/SetStockRejectedOrderStatusCommandHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/SetStockRejectedOrderStatusCommandHandler.cs @@ -10,7 +10,7 @@ namespace Ordering.API.Application.Commands { // Regular CommandHandler public class SetStockRejectedOrderStatusCommandHandler : IRequestHandler - { + { private readonly IOrderRepository _orderRepository; public SetStockRejectedOrderStatusCommandHandler(IOrderRepository orderRepository) @@ -30,10 +30,10 @@ namespace Ordering.API.Application.Commands await Task.Delay(10000, cancellationToken); var orderToUpdate = await _orderRepository.GetAsync(command.OrderNumber); - if(orderToUpdate == null) + if (orderToUpdate == null) { return false; - } + } orderToUpdate.SetCancelledStatusWhenStockIsRejected(command.OrderStockItems); diff --git a/src/Services/Ordering/Ordering.API/Application/Commands/ShipOrderCommand.cs b/src/Services/Ordering/Ordering.API/Application/Commands/ShipOrderCommand.cs index 08f37007d..e267e6b66 100644 --- a/src/Services/Ordering/Ordering.API/Application/Commands/ShipOrderCommand.cs +++ b/src/Services/Ordering/Ordering.API/Application/Commands/ShipOrderCommand.cs @@ -1,9 +1,5 @@ using MediatR; -using System; -using System.Collections.Generic; -using System.Linq; using System.Runtime.Serialization; -using System.Threading.Tasks; namespace Ordering.API.Application.Commands { diff --git a/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderGracePeriodConfirmed/OrderStatusChangedToAwaitingValidationDomainEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderGracePeriodConfirmed/OrderStatusChangedToAwaitingValidationDomainEventHandler.cs index edea66895..82904fdd7 100644 --- a/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderGracePeriodConfirmed/OrderStatusChangedToAwaitingValidationDomainEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderGracePeriodConfirmed/OrderStatusChangedToAwaitingValidationDomainEventHandler.cs @@ -28,7 +28,7 @@ _orderRepository = orderRepository ?? throw new ArgumentNullException(nameof(orderRepository)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _buyerRepository = buyerRepository; - _orderingIntegrationEventService = orderingIntegrationEventService; + _orderingIntegrationEventService = orderingIntegrationEventService; } public async Task Handle(OrderStatusChangedToAwaitingValidationDomainEvent orderStatusChangedToAwaitingValidationDomainEvent, CancellationToken cancellationToken) @@ -48,5 +48,5 @@ order.Id, order.OrderStatus.Name, buyer.Name, orderStockList); await _orderingIntegrationEventService.AddAndSaveEventAsync(orderStatusChangedToAwaitingValidationIntegrationEvent); } - } + } } \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderPaid/OrderStatusChangedToPaidDomainEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderPaid/OrderStatusChangedToPaidDomainEventHandler.cs index a934a621d..fac62e7e2 100644 --- a/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderPaid/OrderStatusChangedToPaidDomainEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderPaid/OrderStatusChangedToPaidDomainEventHandler.cs @@ -19,7 +19,7 @@ private readonly ILoggerFactory _logger; private readonly IBuyerRepository _buyerRepository; private readonly IOrderingIntegrationEventService _orderingIntegrationEventService; - + public OrderStatusChangedToPaidDomainEventHandler( IOrderRepository orderRepository, ILoggerFactory logger, @@ -30,7 +30,7 @@ _orderRepository = orderRepository ?? throw new ArgumentNullException(nameof(orderRepository)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _buyerRepository = buyerRepository ?? throw new ArgumentNullException(nameof(buyerRepository)); - _orderingIntegrationEventService = orderingIntegrationEventService ?? throw new ArgumentNullException(nameof(orderingIntegrationEventService)); + _orderingIntegrationEventService = orderingIntegrationEventService ?? throw new ArgumentNullException(nameof(orderingIntegrationEventService)); } public async Task Handle(OrderStatusChangedToPaidDomainEvent orderStatusChangedToPaidDomainEvent, CancellationToken cancellationToken) @@ -51,7 +51,7 @@ buyer.Name, orderStockList); - await _orderingIntegrationEventService.AddAndSaveEventAsync(orderStatusChangedToPaidIntegrationEvent); + await _orderingIntegrationEventService.AddAndSaveEventAsync(orderStatusChangedToPaidIntegrationEvent); } - } + } } \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderShipped/OrderShippedDomainEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderShipped/OrderShippedDomainEventHandler.cs index 7f4754865..57478c1aa 100644 --- a/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderShipped/OrderShippedDomainEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderShipped/OrderShippedDomainEventHandler.cs @@ -20,7 +20,7 @@ namespace Ordering.API.Application.DomainEventHandlers.OrderShipped private readonly ILoggerFactory _logger; public OrderShippedDomainEventHandler( - IOrderRepository orderRepository, + IOrderRepository orderRepository, ILoggerFactory logger, IBuyerRepository buyerRepository, IOrderingIntegrationEventService orderingIntegrationEventService) diff --git a/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderStartedEvent/SendEmailToCustomerWhenOrderStartedDomainEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderStartedEvent/SendEmailToCustomerWhenOrderStartedDomainEventHandler.cs index 4da9439c2..14fa36615 100644 --- a/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderStartedEvent/SendEmailToCustomerWhenOrderStartedDomainEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderStartedEvent/SendEmailToCustomerWhenOrderStartedDomainEventHandler.cs @@ -1,19 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -using MediatR; -using Ordering.Domain.Events; - -namespace Ordering.API.Application.DomainEventHandlers.OrderStartedEvent +namespace Ordering.API.Application.DomainEventHandlers.OrderStartedEvent { public class SendEmailToCustomerWhenOrderStartedDomainEventHandler - //: IAsyncNotificationHandler - { + //: IAsyncNotificationHandler + { public SendEmailToCustomerWhenOrderStartedDomainEventHandler() { - + } //public async Task Handle(OrderStartedDomainEvent orderNotification) diff --git a/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderStartedEvent/ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderStartedEvent/ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler.cs index 5b8f19b00..44e8ffcf7 100644 --- a/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderStartedEvent/ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderStartedEvent/ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler.cs @@ -1,5 +1,4 @@ using MediatR; -using Microsoft.AspNetCore.Http; using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Services; using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate; using Microsoft.Extensions.Logging; diff --git a/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderStockConfirmed/OrderStatusChangedToStockConfirmedDomainEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderStockConfirmed/OrderStatusChangedToStockConfirmedDomainEventHandler.cs index 0e9ca4f08..eaad5f2d6 100644 --- a/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderStockConfirmed/OrderStatusChangedToStockConfirmedDomainEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/DomainEventHandlers/OrderStockConfirmed/OrderStatusChangedToStockConfirmedDomainEventHandler.cs @@ -20,7 +20,7 @@ private readonly IOrderingIntegrationEventService _orderingIntegrationEventService; public OrderStatusChangedToStockConfirmedDomainEventHandler( - IOrderRepository orderRepository, + IOrderRepository orderRepository, IBuyerRepository buyerRepository, ILoggerFactory logger, IOrderingIntegrationEventService orderingIntegrationEventService) @@ -41,7 +41,7 @@ var buyer = await _buyerRepository.FindByIdAsync(order.GetBuyerId.Value.ToString()); var orderStatusChangedToStockConfirmedIntegrationEvent = new OrderStatusChangedToStockConfirmedIntegrationEvent(order.Id, order.OrderStatus.Name, buyer.Name); - await _orderingIntegrationEventService.AddAndSaveEventAsync(orderStatusChangedToStockConfirmedIntegrationEvent); + await _orderingIntegrationEventService.AddAndSaveEventAsync(orderStatusChangedToStockConfirmedIntegrationEvent); } - } + } } \ No newline at end of file diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/GracePeriodConfirmedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/GracePeriodConfirmedIntegrationEventHandler.cs index 2e003b322..e503695c7 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/GracePeriodConfirmedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/GracePeriodConfirmedIntegrationEventHandler.cs @@ -1,10 +1,7 @@ using MediatR; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; -using Microsoft.eShopOnContainers.Services.Ordering.API; -using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; using Microsoft.Extensions.Logging; -using Ordering.API.Application.Behaviors; using Ordering.API.Application.Commands; using Ordering.API.Application.IntegrationEvents.Events; using Serilog.Context; diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentFailedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentFailedIntegrationEventHandler.cs index a123dd891..cad6123be 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentFailedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentFailedIntegrationEventHandler.cs @@ -3,17 +3,14 @@ using MediatR; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; - using Microsoft.eShopOnContainers.Services.Ordering.API; - using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; using Microsoft.Extensions.Logging; - using Ordering.API.Application.Behaviors; using Ordering.API.Application.Commands; using Ordering.API.Application.IntegrationEvents.Events; using Serilog.Context; - using System.Threading.Tasks; using System; + using System.Threading.Tasks; - public class OrderPaymentFailedIntegrationEventHandler : + public class OrderPaymentFailedIntegrationEventHandler : IIntegrationEventHandler { private readonly IMediator _mediator; diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentSucceededIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentSucceededIntegrationEventHandler.cs index fdb6c2c0b..9971a1a33 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentSucceededIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentSucceededIntegrationEventHandler.cs @@ -3,17 +3,14 @@ using MediatR; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; - using Microsoft.eShopOnContainers.Services.Ordering.API; - using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; using Microsoft.Extensions.Logging; - using Ordering.API.Application.Behaviors; using Ordering.API.Application.Commands; using Ordering.API.Application.IntegrationEvents.Events; using Serilog.Context; using System; using System.Threading.Tasks; - public class OrderPaymentSucceededIntegrationEventHandler : + public class OrderPaymentSucceededIntegrationEventHandler : IIntegrationEventHandler { private readonly IMediator _mediator; diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs index 6438b01d0..8a349fca7 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs @@ -1,17 +1,14 @@ namespace Ordering.API.Application.IntegrationEvents.EventHandling { - using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; - using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; - using System.Threading.Tasks; using Events; - using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; using MediatR; - using System; - using Ordering.API.Application.Commands; + using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; + using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; using Microsoft.Extensions.Logging; + using Ordering.API.Application.Commands; using Serilog.Context; - using Microsoft.eShopOnContainers.Services.Ordering.API; - using Ordering.API.Application.Behaviors; + using System; + using System.Threading.Tasks; public class OrderStockConfirmedIntegrationEventHandler : IIntegrationEventHandler diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs index b457211ed..5819b4fe3 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs @@ -1,17 +1,14 @@ namespace Ordering.API.Application.IntegrationEvents.EventHandling { - using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; - using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; - using System.Threading.Tasks; using Events; - using System.Linq; - using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; using MediatR; - using Ordering.API.Application.Commands; + using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; + using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; using Microsoft.Extensions.Logging; + using Ordering.API.Application.Commands; using Serilog.Context; - using Microsoft.eShopOnContainers.Services.Ordering.API; - using Ordering.API.Application.Behaviors; + using System.Linq; + using System.Threading.Tasks; public class OrderStockRejectedIntegrationEventHandler : IIntegrationEventHandler { diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs index a1452b23c..c16b554c9 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs @@ -2,13 +2,11 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands; -using Microsoft.eShopOnContainers.Services.Ordering.API; using Microsoft.Extensions.Logging; -using Ordering.API.Application.Behaviors; using Ordering.API.Application.IntegrationEvents.Events; using Serilog.Context; -using System.Threading.Tasks; using System; +using System.Threading.Tasks; namespace Ordering.API.Application.IntegrationEvents.EventHandling { @@ -54,7 +52,7 @@ namespace Ordering.API.Application.IntegrationEvents.EventHandling var requestCreateOrder = new IdentifiedCommand(createOrderCommand, @event.RequestId); _logger.LogInformation( - "----- Sending command: {CommandName} - {IdProperty}: {CommandId} ({@Command})", + "----- Sending command: {CommandName} - {IdProperty}: {CommandId} ({@Command})", requestCreateOrder.GetGenericTypeName(), nameof(requestCreateOrder.Id), requestCreateOrder.Id, diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs index a47fb7988..8f11e240f 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs @@ -1,8 +1,4 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Ordering.API.Application.IntegrationEvents.Events { diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs index 673b445cf..72cd4b9f4 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs @@ -1,7 +1,7 @@ namespace Ordering.API.Application.IntegrationEvents.Events { - using System.Collections.Generic; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; + using System.Collections.Generic; public record OrderStatusChangedToAwaitingValidationIntegrationEvent : IntegrationEvent { diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToCancelledIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToCancelledIntegrationEvent.cs index 34524f0c0..b703e8031 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToCancelledIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToCancelledIntegrationEvent.cs @@ -1,8 +1,4 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Ordering.API.Application.IntegrationEvents.Events { diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs index 50d6f7e72..ee5f07487 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs @@ -1,7 +1,7 @@ namespace Ordering.API.Application.IntegrationEvents.Events { - using System.Collections.Generic; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; + using System.Collections.Generic; public record OrderStatusChangedToPaidIntegrationEvent : IntegrationEvent { diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToShippedIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToShippedIntegrationEvent.cs index dc48ac06d..064d07c20 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToShippedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedToShippedIntegrationEvent.cs @@ -1,8 +1,4 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Ordering.API.Application.IntegrationEvents.Events { diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedTosubmittedIntegrationEvent.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedTosubmittedIntegrationEvent.cs index 82f1125da..77b567ec8 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedTosubmittedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/Events/OrderStatusChangedTosubmittedIntegrationEvent.cs @@ -1,8 +1,4 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Ordering.API.Application.IntegrationEvents.Events { diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/OrderingIntegrationEventService.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/OrderingIntegrationEventService.cs index 28cf08c4b..a559a8ffa 100644 --- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/OrderingIntegrationEventService.cs +++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/OrderingIntegrationEventService.cs @@ -1,17 +1,12 @@ using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services; -using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Utilities; -using Microsoft.eShopOnContainers.Services.Ordering.API; using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure; using Microsoft.Extensions.Logging; using System; using System.Data.Common; -using System.Diagnostics; -using System.Linq; using System.Threading.Tasks; namespace Ordering.API.Application.IntegrationEvents diff --git a/src/Services/Ordering/Ordering.API/Application/Models/BasketItem.cs b/src/Services/Ordering/Ordering.API/Application/Models/BasketItem.cs index 16830919d..5c7df3338 100644 --- a/src/Services/Ordering/Ordering.API/Application/Models/BasketItem.cs +++ b/src/Services/Ordering/Ordering.API/Application/Models/BasketItem.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Ordering.API.Application.Models +namespace Ordering.API.Application.Models { public class BasketItem { diff --git a/src/Services/Ordering/Ordering.API/Application/Models/CustomerBasket.cs b/src/Services/Ordering/Ordering.API/Application/Models/CustomerBasket.cs index 0275d1f80..e455f5d7d 100644 --- a/src/Services/Ordering/Ordering.API/Application/Models/CustomerBasket.cs +++ b/src/Services/Ordering/Ordering.API/Application/Models/CustomerBasket.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using System.Collections.Generic; namespace Ordering.API.Application.Models { diff --git a/src/Services/Ordering/Ordering.API/Application/Queries/OrderQueries.cs b/src/Services/Ordering/Ordering.API/Application/Queries/OrderQueries.cs index 8509e10d3..ceffa9039 100644 --- a/src/Services/Ordering/Ordering.API/Application/Queries/OrderQueries.cs +++ b/src/Services/Ordering/Ordering.API/Application/Queries/OrderQueries.cs @@ -1,10 +1,10 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Queries { using Dapper; - using System.Data.SqlClient; - using System.Threading.Tasks; using System; using System.Collections.Generic; + using System.Data.SqlClient; + using System.Threading.Tasks; public class OrderQueries : IOrderQueries diff --git a/src/Services/Ordering/Ordering.API/Application/Validations/IdentifiedCommandValidator.cs b/src/Services/Ordering/Ordering.API/Application/Validations/IdentifiedCommandValidator.cs index d79bf42e4..ea928475d 100644 --- a/src/Services/Ordering/Ordering.API/Application/Validations/IdentifiedCommandValidator.cs +++ b/src/Services/Ordering/Ordering.API/Application/Validations/IdentifiedCommandValidator.cs @@ -4,7 +4,7 @@ using Microsoft.Extensions.Logging; namespace Ordering.API.Application.Validations { - public class IdentifiedCommandValidator : AbstractValidator> + public class IdentifiedCommandValidator : AbstractValidator> { public IdentifiedCommandValidator(ILogger logger) { diff --git a/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs b/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs index 7a592bfb8..e31568d98 100644 --- a/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs +++ b/src/Services/Ordering/Ordering.API/Controllers/OrdersController.cs @@ -6,7 +6,6 @@ using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands; using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Queries; using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Services; using Microsoft.Extensions.Logging; -using Ordering.API.Application.Behaviors; using Ordering.API.Application.Commands; using System; using System.Collections.Generic; @@ -26,8 +25,8 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers private readonly ILogger _logger; public OrdersController( - IMediator mediator, - IOrderQueries orderQueries, + IMediator mediator, + IOrderQueries orderQueries, IIdentityService identityService, ILogger logger) { @@ -41,7 +40,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers [HttpPut] [ProducesResponseType((int)HttpStatusCode.OK)] [ProducesResponseType((int)HttpStatusCode.BadRequest)] - public async Task CancelOrderAsync([FromBody]CancelOrderCommand command, [FromHeader(Name = "x-requestid")] string requestId) + public async Task CancelOrderAsync([FromBody] CancelOrderCommand command, [FromHeader(Name = "x-requestid")] string requestId) { bool commandResult = false; @@ -71,7 +70,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers [HttpPut] [ProducesResponseType((int)HttpStatusCode.OK)] [ProducesResponseType((int)HttpStatusCode.BadRequest)] - public async Task ShipOrderAsync([FromBody]ShipOrderCommand command, [FromHeader(Name = "x-requestid")] string requestId) + public async Task ShipOrderAsync([FromBody] ShipOrderCommand command, [FromHeader(Name = "x-requestid")] string requestId) { bool commandResult = false; @@ -99,7 +98,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers [Route("{orderId:int}")] [HttpGet] - [ProducesResponseType(typeof(Order),(int)HttpStatusCode.OK)] + [ProducesResponseType(typeof(Order), (int)HttpStatusCode.OK)] [ProducesResponseType((int)HttpStatusCode.NotFound)] public async Task GetOrderAsync(int orderId) { diff --git a/src/Services/Ordering/Ordering.API/Extensions/BasketItemExtensions.cs b/src/Services/Ordering/Ordering.API/Extensions/BasketItemExtensions.cs index ba2b7e01f..bbbc679ba 100644 --- a/src/Services/Ordering/Ordering.API/Extensions/BasketItemExtensions.cs +++ b/src/Services/Ordering/Ordering.API/Extensions/BasketItemExtensions.cs @@ -1,8 +1,4 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using System.Collections.Generic; using static Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands.CreateOrderCommand; namespace Ordering.API.Application.Models diff --git a/src/Services/Ordering/Ordering.API/Grpc/OrderingService.cs b/src/Services/Ordering/Ordering.API/Grpc/OrderingService.cs index 5effedc1d..3ae6c1733 100644 --- a/src/Services/Ordering/Ordering.API/Grpc/OrderingService.cs +++ b/src/Services/Ordering/Ordering.API/Grpc/OrderingService.cs @@ -1,15 +1,13 @@ -using Microsoft.AspNetCore.Authorization; +using Google.Protobuf.Collections; +using Grpc.Core; +using MediatR; +using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; using Microsoft.Extensions.Logging; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands; -using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; -using MediatR; -using Grpc.Core; -using AppCommand = Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands; using ApiModels = Ordering.API.Application.Models; -using Google.Protobuf.Collections; -using System.Collections.Generic; +using AppCommand = Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands; namespace GrpcOrdering { diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Auth/AuthorizationHeaderParameterOperationFilter.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Auth/AuthorizationHeaderParameterOperationFilter.cs index 7e30a69fc..bc7916188 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Auth/AuthorizationHeaderParameterOperationFilter.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Auth/AuthorizationHeaderParameterOperationFilter.cs @@ -1,6 +1,5 @@ using Microsoft.AspNetCore.Mvc.Authorization; using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.SwaggerGen; using System.Collections.Generic; using System.Linq; diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/ApplicationModule.cs b/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/ApplicationModule.cs index dbda8bc14..1d8f45353 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/ApplicationModule.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/ApplicationModule.cs @@ -12,7 +12,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Autof { public class ApplicationModule - :Autofac.Module + : Autofac.Module { public string QueriesConnectionString { get; } diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/MediatorModule.cs b/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/MediatorModule.cs index 67275a587..91e9a5149 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/MediatorModule.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/AutofacModules/MediatorModule.cs @@ -1,12 +1,12 @@ -using System.Linq; -using System.Reflection; -using Autofac; +using Autofac; using FluentValidation; using MediatR; using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands; using Ordering.API.Application.Behaviors; using Ordering.API.Application.DomainEventHandlers.OrderStartedEvent; using Ordering.API.Application.Validations; +using System.Linq; +using System.Reflection; namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.AutofacModules { diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Factories/OrderingDbContextFactory.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Factories/OrderingDbContextFactory.cs index a3079b32f..56ec898af 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Factories/OrderingDbContextFactory.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Factories/OrderingDbContextFactory.cs @@ -1,22 +1,12 @@ -using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using System; -using System.Collections.Generic; -using System.IO; -using System.IO.Compression; -using System.Linq; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore.Design; using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; +using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure; using Microsoft.Extensions.Configuration; +using System.IO; namespace Ordering.API.Infrastructure.Factories { - public class OrderingDbContextFactory : IDesignTimeDbContextFactory + public class OrderingDbContextFactory : IDesignTimeDbContextFactory { public OrderingContext CreateDbContext(string[] args) { diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/IntegrationEventMigrations/20170330131634_IntegrationEventInitial.cs b/src/Services/Ordering/Ordering.API/Infrastructure/IntegrationEventMigrations/20170330131634_IntegrationEventInitial.cs index 9830ebf7b..a6bbd8765 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/IntegrationEventMigrations/20170330131634_IntegrationEventInitial.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/IntegrationEventMigrations/20170330131634_IntegrationEventInitial.cs @@ -1,6 +1,5 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; +using System; namespace Ordering.API.Infrastructure.IntegrationEventMigrations { diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170208181933_Initial.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170208181933_Initial.cs index 5346cef60..a489f0e28 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170208181933_Initial.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170208181933_Initial.cs @@ -1,7 +1,6 @@ -using System; -using System.Collections.Generic; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Metadata; +using System; namespace Ordering.API.Migrations { diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170303085729_RequestsTable.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170303085729_RequestsTable.cs index 5e5918c88..e0fb2dedf 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170303085729_RequestsTable.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170303085729_RequestsTable.cs @@ -1,6 +1,5 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; +using System; namespace Ordering.API.Migrations { diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170313100034_Domain_events.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170313100034_Domain_events.cs index d68cedd80..3105e1afc 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170313100034_Domain_events.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170313100034_Domain_events.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Ordering.API.Migrations { diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170403082405_NoBuyerPropertyInOrder.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170403082405_NoBuyerPropertyInOrder.cs index 03fe54686..6c7b9ed50 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170403082405_NoBuyerPropertyInOrder.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170403082405_NoBuyerPropertyInOrder.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Ordering.API.Migrations { diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170405110939_NoPaymentMethodPropertyInOrder.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170405110939_NoPaymentMethodPropertyInOrder.cs index 4a6a22f67..33859cf7b 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170405110939_NoPaymentMethodPropertyInOrder.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170405110939_NoPaymentMethodPropertyInOrder.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Ordering.API.Migrations { diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170511112333_AddOrderDescription.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170511112333_AddOrderDescription.cs index 028babb96..40f5002c7 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170511112333_AddOrderDescription.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170511112333_AddOrderDescription.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Ordering.API.Migrations { diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170713111342_AdressAsValueObject.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170713111342_AdressAsValueObject.cs index 9f5d28d99..03b8df2bd 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170713111342_AdressAsValueObject.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20170713111342_AdressAsValueObject.cs @@ -1,7 +1,5 @@ using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; namespace Ordering.API.Migrations { diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20180412143935_NamePropertyInBuyer.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20180412143935_NamePropertyInBuyer.cs index 7a2637384..0314dfea5 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20180412143935_NamePropertyInBuyer.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20180412143935_NamePropertyInBuyer.cs @@ -1,6 +1,4 @@ using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; namespace Ordering.API.Infrastructure.Migrations { @@ -11,7 +9,7 @@ namespace Ordering.API.Infrastructure.Migrations migrationBuilder.DropForeignKey( name: "FK_orderItems_orders_OrderId", schema: "ordering", - table: "orderItems"); + table: "orderItems"); migrationBuilder.AddColumn( name: "Name", diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20190808132242_Change_Relation_Of_Orders.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20190808132242_Change_Relation_Of_Orders.cs index ba01fdcec..d459f31b1 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20190808132242_Change_Relation_Of_Orders.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Migrations/20190808132242_Change_Relation_Of_Orders.cs @@ -10,7 +10,7 @@ namespace Ordering.API.Infrastructure.Migrations protected override void Down(MigrationBuilder migrationBuilder) { - + } } } diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs b/src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs index 89148f43a..35b79e505 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/OrderingContextSeed.cs @@ -20,7 +20,7 @@ public class OrderingContextSeed { - public async Task SeedAsync(OrderingContext context, IWebHostEnvironment env,IOptions settings, ILogger logger) + public async Task SeedAsync(OrderingContext context, IWebHostEnvironment env, IOptions settings, ILogger logger) { var policy = CreatePolicy(logger, nameof(OrderingContextSeed)); @@ -174,8 +174,8 @@ return csvheaders; } - - private AsyncRetryPolicy CreatePolicy( ILogger logger, string prefix, int retries =3) + + private AsyncRetryPolicy CreatePolicy(ILogger logger, string prefix, int retries = 3) { return Policy.Handle(). WaitAndRetryAsync( diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Services/IIdentityService.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Services/IIdentityService.cs index dedf7b34f..e51452d7d 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Services/IIdentityService.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Services/IIdentityService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Services +namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Services { public interface IIdentityService { diff --git a/src/Services/Ordering/Ordering.API/Infrastructure/Services/IdentityService.cs b/src/Services/Ordering/Ordering.API/Infrastructure/Services/IdentityService.cs index f152e290c..4dab338c4 100644 --- a/src/Services/Ordering/Ordering.API/Infrastructure/Services/IdentityService.cs +++ b/src/Services/Ordering/Ordering.API/Infrastructure/Services/IdentityService.cs @@ -1,15 +1,12 @@  using Microsoft.AspNetCore.Http; using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Services { public class IdentityService : IIdentityService { - private IHttpContextAccessor _context; + private IHttpContextAccessor _context; public IdentityService(IHttpContextAccessor context) { diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs b/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs index 8b1c80171..81ad74c51 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Startup.cs @@ -1,7 +1,6 @@ namespace Ordering.BackgroundTasks { - using Autofac; - using Autofac.Extensions.DependencyInjection; + using HealthChecks.UI.Client; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.Extensions.Configuration; @@ -9,8 +8,6 @@ using Microsoft.Extensions.Logging; using Ordering.BackgroundTasks.Extensions; using Ordering.BackgroundTasks.Tasks; - using System; - using HealthChecks.UI.Client; public class Startup { diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs index 1269fd259..a3de10052 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/Buyer.cs @@ -13,11 +13,12 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B public string Name { get; private set; } - private List _paymentMethods; + private List _paymentMethods; public IEnumerable PaymentMethods => _paymentMethods.AsReadOnly(); - protected Buyer() { + protected Buyer() + { _paymentMethods = new List(); } @@ -29,7 +30,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B } public PaymentMethod VerifyOrAddPaymentMethod( - int cardTypeId, string alias, string cardNumber, + int cardTypeId, string alias, string cardNumber, string securityNumber, string cardHolderName, DateTime expiration, int orderId) { var existingPayment = _paymentMethods @@ -49,6 +50,6 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B AddDomainEvent(new BuyerAndPaymentMethodVerifiedDomainEvent(this, payment, orderId)); return payment; - } + } } } diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/PaymentMethod.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/PaymentMethod.cs index b307604da..bd245d1a8 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/PaymentMethod.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/BuyerAggregate/PaymentMethod.cs @@ -36,7 +36,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.B _cardTypeId = cardTypeId; } - public bool IsEqualTo(int cardTypeId, string cardNumber,DateTime expiration) + public bool IsEqualTo(int cardTypeId, string cardNumber, DateTime expiration) { return _cardTypeId == cardTypeId && _cardNumber == cardNumber diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/IOrderRepository.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/IOrderRepository.cs index d7346ee4f..a4e298cd7 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/IOrderRepository.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/IOrderRepository.cs @@ -9,7 +9,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O public interface IOrderRepository : IRepository { Order Add(Order order); - + void Update(Order order); Task GetAsync(int orderId); diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/OrderItem.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/OrderItem.cs index b3b7435e3..9fbec8225 100644 --- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/OrderItem.cs +++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/OrderItem.cs @@ -1,6 +1,5 @@ using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork; using Ordering.Domain.Exceptions; -using System; namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate { @@ -10,11 +9,11 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O // DDD Patterns comment // Using private fields, allowed since EF Core 1.1, is a much better encapsulation // aligned with DDD Aggregates and Domain Entities (Instead of properties and property collections) - private string _productName; - private string _pictureUrl; + private string _productName; + private string _pictureUrl; private decimal _unitPrice; private decimal _discount; - private int _units; + private int _units; public int ProductId { get; private set; } diff --git a/src/Services/Ordering/Ordering.Domain/Events/OrderCancelledDomainEvent.cs b/src/Services/Ordering/Ordering.Domain/Events/OrderCancelledDomainEvent.cs index 2e53c82c1..144527fbf 100644 --- a/src/Services/Ordering/Ordering.Domain/Events/OrderCancelledDomainEvent.cs +++ b/src/Services/Ordering/Ordering.Domain/Events/OrderCancelledDomainEvent.cs @@ -1,8 +1,5 @@ using MediatR; using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; -using System; -using System.Collections.Generic; -using System.Text; namespace Ordering.Domain.Events { diff --git a/src/Services/Ordering/Ordering.Domain/Events/OrderShippedDomainEvent.cs b/src/Services/Ordering/Ordering.Domain/Events/OrderShippedDomainEvent.cs index cad23ecfe..53fcef510 100644 --- a/src/Services/Ordering/Ordering.Domain/Events/OrderShippedDomainEvent.cs +++ b/src/Services/Ordering/Ordering.Domain/Events/OrderShippedDomainEvent.cs @@ -9,7 +9,7 @@ namespace Ordering.Domain.Events public OrderShippedDomainEvent(Order order) { - Order = order; + Order = order; } } } diff --git a/src/Services/Ordering/Ordering.Domain/Events/OrderStartedDomainEvent.cs b/src/Services/Ordering/Ordering.Domain/Events/OrderStartedDomainEvent.cs index 3ab95b3f2..ed779d4bc 100644 --- a/src/Services/Ordering/Ordering.Domain/Events/OrderStartedDomainEvent.cs +++ b/src/Services/Ordering/Ordering.Domain/Events/OrderStartedDomainEvent.cs @@ -1,8 +1,6 @@ using MediatR; using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; using System; -using System.Collections.Generic; -using System.Text; namespace Ordering.Domain.Events { @@ -21,8 +19,8 @@ namespace Ordering.Domain.Events public Order Order { get; } public OrderStartedDomainEvent(Order order, string userId, string userName, - int cardTypeId, string cardNumber, - string cardSecurityNumber, string cardHolderName, + int cardTypeId, string cardNumber, + string cardSecurityNumber, string cardHolderName, DateTime cardExpiration) { Order = order; diff --git a/src/Services/Ordering/Ordering.Domain/Exceptions/OrderingDomainException.cs b/src/Services/Ordering/Ordering.Domain/Exceptions/OrderingDomainException.cs index 7a7320dbf..80c2262ca 100644 --- a/src/Services/Ordering/Ordering.Domain/Exceptions/OrderingDomainException.cs +++ b/src/Services/Ordering/Ordering.Domain/Exceptions/OrderingDomainException.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; namespace Ordering.Domain.Exceptions { diff --git a/src/Services/Ordering/Ordering.Domain/SeedWork/Entity.cs b/src/Services/Ordering/Ordering.Domain/SeedWork/Entity.cs index a1f2fa1c8..f58df286b 100644 --- a/src/Services/Ordering/Ordering.Domain/SeedWork/Entity.cs +++ b/src/Services/Ordering/Ordering.Domain/SeedWork/Entity.cs @@ -1,14 +1,14 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork { - using System; using MediatR; + using System; using System.Collections.Generic; public abstract class Entity { int? _requestedHashCode; - int _Id; - public virtual int Id + int _Id; + public virtual int Id { get { diff --git a/src/Services/Ordering/Ordering.Domain/SeedWork/IAggregateRoot.cs b/src/Services/Ordering/Ordering.Domain/SeedWork/IAggregateRoot.cs index 198f37542..47a8dc7b5 100644 --- a/src/Services/Ordering/Ordering.Domain/SeedWork/IAggregateRoot.cs +++ b/src/Services/Ordering/Ordering.Domain/SeedWork/IAggregateRoot.cs @@ -1,6 +1,6 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork { - + public interface IAggregateRoot { } } diff --git a/src/Services/Ordering/Ordering.Domain/SeedWork/IUnitOfWork.cs b/src/Services/Ordering/Ordering.Domain/SeedWork/IUnitOfWork.cs index 810f0b2af..a6cfca7c6 100644 --- a/src/Services/Ordering/Ordering.Domain/SeedWork/IUnitOfWork.cs +++ b/src/Services/Ordering/Ordering.Domain/SeedWork/IUnitOfWork.cs @@ -5,7 +5,7 @@ using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork { public interface IUnitOfWork : IDisposable - { + { Task SaveChangesAsync(CancellationToken cancellationToken = default(CancellationToken)); Task SaveEntitiesAsync(CancellationToken cancellationToken = default(CancellationToken)); } diff --git a/src/Services/Ordering/Ordering.FunctionalTests/OrderingScenarioBase.cs b/src/Services/Ordering/Ordering.FunctionalTests/OrderingScenarioBase.cs index c7645cc3d..962ce21c1 100644 --- a/src/Services/Ordering/Ordering.FunctionalTests/OrderingScenarioBase.cs +++ b/src/Services/Ordering/Ordering.FunctionalTests/OrderingScenarioBase.cs @@ -1,18 +1,15 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; -using System; -using System.Collections.Generic; -using System.IO; -using System.Reflection; -using System.Text; -using Microsoft.Extensions.Configuration; +using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; +using Microsoft.eShopOnContainers.Services.Ordering.API; +using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure; using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.eShopOnContainers.Services.Ordering.API; -using Microsoft.Extensions.Options; using Microsoft.Extensions.Logging; -using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure; -using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; +using Microsoft.Extensions.Options; +using System.IO; +using System.Reflection; namespace Ordering.FunctionalTests { @@ -31,7 +28,7 @@ namespace Ordering.FunctionalTests .AddEnvironmentVariables(); }).UseStartup(); - var testServer = new TestServer(hostBuilder); + var testServer = new TestServer(hostBuilder); testServer.Host .MigrateDbContext((context, services) => diff --git a/src/Services/Ordering/Ordering.FunctionalTests/OrderingTestStartup.cs b/src/Services/Ordering/Ordering.FunctionalTests/OrderingTestStartup.cs index 9d1975cb7..7980d5bff 100644 --- a/src/Services/Ordering/Ordering.FunctionalTests/OrderingTestStartup.cs +++ b/src/Services/Ordering/Ordering.FunctionalTests/OrderingTestStartup.cs @@ -1,9 +1,9 @@ -using System; -using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Routing; using Microsoft.eShopOnContainers.Services.Ordering.API; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using System; namespace Ordering.FunctionalTests { diff --git a/src/Services/Ordering/Ordering.Infrastructure/Idempotency/RequestManager.cs b/src/Services/Ordering/Ordering.Infrastructure/Idempotency/RequestManager.cs index 6b6a96579..f2ae2d876 100644 --- a/src/Services/Ordering/Ordering.Infrastructure/Idempotency/RequestManager.cs +++ b/src/Services/Ordering/Ordering.Infrastructure/Idempotency/RequestManager.cs @@ -23,11 +23,11 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempoten } public async Task CreateRequestForCommandAsync(Guid id) - { + { var exists = await ExistAsync(id); - var request = exists ? - throw new OrderingDomainException($"Request with {id} already exists") : + var request = exists ? + throw new OrderingDomainException($"Request with {id} already exists") : new ClientRequest() { Id = id, diff --git a/src/Services/Ordering/Ordering.Infrastructure/Repositories/BuyerRepository.cs b/src/Services/Ordering/Ordering.Infrastructure/Repositories/BuyerRepository.cs index e879c423b..2e7b41bd6 100644 --- a/src/Services/Ordering/Ordering.Infrastructure/Repositories/BuyerRepository.cs +++ b/src/Services/Ordering/Ordering.Infrastructure/Repositories/BuyerRepository.cs @@ -35,7 +35,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositor else { return buyer; - } + } } public Buyer Update(Buyer buyer) diff --git a/src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs b/src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs index f2e13577c..040256cf6 100644 --- a/src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs +++ b/src/Services/Ordering/Ordering.Infrastructure/Repositories/OrderRepository.cs @@ -1,7 +1,6 @@ using Microsoft.EntityFrameworkCore; using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork; -using Ordering.Domain.Exceptions; using System; using System.Linq; using System.Threading.Tasks; @@ -28,7 +27,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositor public Order Add(Order order) { - return _context.Orders.Add(order).Entity; + return _context.Orders.Add(order).Entity; } diff --git a/src/Services/Ordering/Ordering.SignalrHub/AutofacModules/ApplicationModule.cs b/src/Services/Ordering/Ordering.SignalrHub/AutofacModules/ApplicationModule.cs index 030d3b8b5..e7b09f636 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/AutofacModules/ApplicationModule.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/AutofacModules/ApplicationModule.cs @@ -1,11 +1,7 @@ using Autofac; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Ordering.SignalrHub.IntegrationEvents; -using System; -using System.Collections.Generic; -using System.Linq; using System.Reflection; -using System.Threading.Tasks; namespace Ordering.SignalrHub.AutofacModules { diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs index 0e2665232..17e2efa90 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs @@ -3,8 +3,6 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.Extensions.Logging; using Serilog.Context; using System; -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; namespace Ordering.SignalrHub.IntegrationEvents diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToCancelledIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToCancelledIntegrationEventHandler.cs index 6257bb237..829ec39b8 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToCancelledIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToCancelledIntegrationEventHandler.cs @@ -4,8 +4,6 @@ using Microsoft.Extensions.Logging; using Ordering.SignalrHub.IntegrationEvents.Events; using Serilog.Context; using System; -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; namespace Ordering.SignalrHub.IntegrationEvents.EventHandling diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToShippedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToShippedIntegrationEventHandler.cs index 5b08d08b4..40664c268 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToShippedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToShippedIntegrationEventHandler.cs @@ -4,8 +4,6 @@ using Microsoft.Extensions.Logging; using Ordering.SignalrHub.IntegrationEvents.Events; using Serilog.Context; using System; -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; namespace Ordering.SignalrHub.IntegrationEvents.EventHandling diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs index 348627716..3ffddfff9 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToStockConfirmedIntegrationEventHandler.cs @@ -4,8 +4,6 @@ using Microsoft.Extensions.Logging; using Ordering.SignalrHub.IntegrationEvents.Events; using Serilog.Context; using System; -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; namespace Ordering.SignalrHub.IntegrationEvents.EventHandling diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToSubmittedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToSubmittedIntegrationEventHandler.cs index 422bc4a7a..e9109939e 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToSubmittedIntegrationEventHandler.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/EventHandling/OrderStatusChangedToSubmittedIntegrationEventHandler.cs @@ -4,8 +4,6 @@ using Microsoft.Extensions.Logging; using Ordering.SignalrHub.IntegrationEvents.Events; using Serilog.Context; using System; -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; namespace Ordering.SignalrHub.IntegrationEvents.EventHandling diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs index c1a3e0a27..dc1727951 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToAwaitingValidationIntegrationEvent.cs @@ -1,5 +1,4 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System.Collections.Generic; namespace Ordering.SignalrHub.IntegrationEvents { diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToCancelledIntegrationEvent.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToCancelledIntegrationEvent.cs index 038b14a5a..1ea290082 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToCancelledIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToCancelledIntegrationEvent.cs @@ -1,8 +1,4 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Ordering.SignalrHub.IntegrationEvents.Events { diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs index 349c9f1a7..e3bf88190 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs @@ -1,8 +1,4 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Ordering.SignalrHub.IntegrationEvents.Events { diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToShippedIntegrationEvent.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToShippedIntegrationEvent.cs index 4804dd504..436b5a95a 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToShippedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToShippedIntegrationEvent.cs @@ -1,8 +1,4 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Ordering.SignalrHub.IntegrationEvents.Events { diff --git a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToSubmittedIntegrationEvent.cs b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToSubmittedIntegrationEvent.cs index 3b1e04438..0d2de4abe 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToSubmittedIntegrationEvent.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/IntegrationEvents/Events/OrderStatusChangedToSubmittedIntegrationEvent.cs @@ -1,8 +1,4 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Ordering.SignalrHub.IntegrationEvents.Events { diff --git a/src/Services/Ordering/Ordering.SignalrHub/NotificationHub.cs b/src/Services/Ordering/Ordering.SignalrHub/NotificationHub.cs index 943198980..7696a4da1 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/NotificationHub.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/NotificationHub.cs @@ -1,8 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.SignalR; using System; -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; namespace Ordering.SignalrHub diff --git a/src/Services/Ordering/Ordering.SignalrHub/Program.cs b/src/Services/Ordering/Ordering.SignalrHub/Program.cs index c278697ba..aa817e5b0 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Program.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/Program.cs @@ -1,13 +1,10 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore; +using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using Serilog; +using System; +using System.IO; namespace Ordering.SignalrHub { diff --git a/src/Services/Ordering/Ordering.SignalrHub/Startup.cs b/src/Services/Ordering/Ordering.SignalrHub/Startup.cs index 31cbe1951..11f239119 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Startup.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/Startup.cs @@ -19,8 +19,8 @@ using Ordering.SignalrHub.IntegrationEvents.EventHandling; using Ordering.SignalrHub.IntegrationEvents.Events; using RabbitMQ.Client; using System; -using System.Threading.Tasks; using System.IdentityModel.Tokens.Jwt; +using System.Threading.Tasks; namespace Ordering.SignalrHub { diff --git a/src/Services/Ordering/Ordering.UnitTests/Application/IdentifiedCommandHandlerTest.cs b/src/Services/Ordering/Ordering.UnitTests/Application/IdentifiedCommandHandlerTest.cs index 95bc4cc81..62818115d 100644 --- a/src/Services/Ordering/Ordering.UnitTests/Application/IdentifiedCommandHandlerTest.cs +++ b/src/Services/Ordering/Ordering.UnitTests/Application/IdentifiedCommandHandlerTest.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Text; namespace UnitTest.Ordering.Application { @@ -10,7 +8,6 @@ namespace UnitTest.Ordering.Application using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency; using Microsoft.Extensions.Logging; using Moq; - using System.Collections; using System.Collections.Generic; using System.Threading.Tasks; using Xunit; @@ -37,7 +34,7 @@ namespace UnitTest.Ordering.Application _requestManager.Setup(x => x.ExistAsync(It.IsAny())) .Returns(Task.FromResult(false)); - _mediator.Setup(x => x.Send(It.IsAny>(),default(System.Threading.CancellationToken))) + _mediator.Setup(x => x.Send(It.IsAny>(), default(System.Threading.CancellationToken))) .Returns(Task.FromResult(true)); //Act diff --git a/src/Services/Ordering/Ordering.UnitTests/Application/NewOrderCommandHandlerTest.cs b/src/Services/Ordering/Ordering.UnitTests/Application/NewOrderCommandHandlerTest.cs index 77fede857..78d7dbed7 100644 --- a/src/Services/Ordering/Ordering.UnitTests/Application/NewOrderCommandHandlerTest.cs +++ b/src/Services/Ordering/Ordering.UnitTests/Application/NewOrderCommandHandlerTest.cs @@ -14,10 +14,8 @@ namespace UnitTest.Ordering.Application using global::Ordering.API.Application.Models; using MediatR; using Microsoft.Extensions.Logging; - using System.Collections; using System.Collections.Generic; using Xunit; - using static Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands.CreateOrderCommand; public class NewOrderRequestHandlerTest { @@ -93,7 +91,7 @@ namespace UnitTest.Ordering.Application cardExpiration: args != null && args.ContainsKey("cardExpiration") ? (DateTime)args["cardExpiration"] : DateTime.MinValue, cardSecurityNumber: args != null && args.ContainsKey("cardSecurityNumber") ? (string)args["cardSecurityNumber"] : "123", cardHolderName: args != null && args.ContainsKey("cardHolderName") ? (string)args["cardHolderName"] : "XXX", - cardTypeId: args != null && args.ContainsKey("cardTypeId") ? (int)args["cardTypeId"] : 0); + cardTypeId: args != null && args.ContainsKey("cardTypeId") ? (int)args["cardTypeId"] : 0); } } } diff --git a/src/Services/Ordering/Ordering.UnitTests/Builders.cs b/src/Services/Ordering/Ordering.UnitTests/Builders.cs index 3103aee19..2e9415274 100644 --- a/src/Services/Ordering/Ordering.UnitTests/Builders.cs +++ b/src/Services/Ordering/Ordering.UnitTests/Builders.cs @@ -1,5 +1,5 @@ -using System; -using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; +using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; +using System; namespace UnitTest.Ordering { @@ -21,11 +21,11 @@ namespace UnitTest.Ordering "userId", "fakeName", address, - cardTypeId:5, - cardNumber:"12", - cardSecurityNumber:"123", - cardHolderName:"name", - cardExpiration:DateTime.UtcNow); + cardTypeId: 5, + cardNumber: "12", + cardSecurityNumber: "123", + cardHolderName: "name", + cardExpiration: DateTime.UtcNow); } public OrderBuilder AddOne( diff --git a/src/Services/Ordering/Ordering.UnitTests/Domain/BuyerAggregateTest.cs b/src/Services/Ordering/Ordering.UnitTests/Domain/BuyerAggregateTest.cs index 588b929fd..7f3832059 100644 --- a/src/Services/Ordering/Ordering.UnitTests/Domain/BuyerAggregateTest.cs +++ b/src/Services/Ordering/Ordering.UnitTests/Domain/BuyerAggregateTest.cs @@ -35,7 +35,7 @@ public class BuyerAggregateTest [Fact] public void add_payment_success() - { + { //Arrange var cardTypeId = 1; var alias = "fakeAlias"; @@ -83,7 +83,7 @@ public class BuyerAggregateTest var cardNumber = "124"; var securityNumber = "1234"; var cardHolderName = "FakeHolderNAme"; - var expiration = DateTime.Now.AddYears(-1); + var expiration = DateTime.Now.AddYears(-1); //Act - Assert Assert.Throws(() => new PaymentMethod(cardTypeId, alias, cardNumber, securityNumber, cardHolderName, expiration)); diff --git a/src/Services/Ordering/Ordering.UnitTests/Domain/OrderAggregateTest.cs b/src/Services/Ordering/Ordering.UnitTests/Domain/OrderAggregateTest.cs index bf0678f5f..105d64079 100644 --- a/src/Services/Ordering/Ordering.UnitTests/Domain/OrderAggregateTest.cs +++ b/src/Services/Ordering/Ordering.UnitTests/Domain/OrderAggregateTest.cs @@ -2,7 +2,6 @@ using Ordering.Domain.Events; using Ordering.Domain.Exceptions; using System; -using System.Linq; using UnitTest.Ordering; using Xunit; @@ -100,8 +99,8 @@ public class OrderAggregateTest { var address = new AddressBuilder().Build(); var order = new OrderBuilder(address) - .AddOne(1,"cup",10.0m,0,string.Empty) - .AddOne(1,"cup",10.0m,0,string.Empty) + .AddOne(1, "cup", 10.0m, 0, string.Empty) + .AddOne(1, "cup", 10.0m, 0, string.Empty) .Build(); Assert.Equal(20.0m, order.GetTotal()); @@ -148,7 +147,7 @@ public class OrderAggregateTest //Act var fakeOrder = new Order("1", "fakeName", new Address(street, city, state, country, zipcode), cardTypeId, cardNumber, cardSecurityNumber, cardHolderName, cardExpiration); - fakeOrder.AddDomainEvent(new OrderStartedDomainEvent(fakeOrder, "fakeName", "1", cardTypeId,cardNumber,cardSecurityNumber,cardHolderName,cardExpiration)); + fakeOrder.AddDomainEvent(new OrderStartedDomainEvent(fakeOrder, "fakeName", "1", cardTypeId, cardNumber, cardSecurityNumber, cardHolderName, cardExpiration)); //Assert Assert.Equal(fakeOrder.DomainEvents.Count, expectedResult); } diff --git a/src/Services/Ordering/Ordering.UnitTests/Domain/SeedWork/ValueObjectTests.cs b/src/Services/Ordering/Ordering.UnitTests/Domain/SeedWork/ValueObjectTests.cs index 7eed01fe6..bbfa340d2 100644 --- a/src/Services/Ordering/Ordering.UnitTests/Domain/SeedWork/ValueObjectTests.cs +++ b/src/Services/Ordering/Ordering.UnitTests/Domain/SeedWork/ValueObjectTests.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using Xunit; namespace Ordering.UnitTests.Domain.SeedWork diff --git a/src/Services/Webhooks/Webhooks.API/Controllers/WebhooksController.cs b/src/Services/Webhooks/Webhooks.API/Controllers/WebhooksController.cs index d435fc0e5..075b220dc 100644 --- a/src/Services/Webhooks/Webhooks.API/Controllers/WebhooksController.cs +++ b/src/Services/Webhooks/Webhooks.API/Controllers/WebhooksController.cs @@ -87,7 +87,7 @@ namespace Webhooks.API.Controllers else { return StatusCode(418, "Grant url can't be validated"); - } + } } [Authorize] diff --git a/src/Services/Webhooks/Webhooks.API/Exceptions/WebhooksDomainException.cs b/src/Services/Webhooks/Webhooks.API/Exceptions/WebhooksDomainException.cs index 8d4024583..6307a6296 100644 --- a/src/Services/Webhooks/Webhooks.API/Exceptions/WebhooksDomainException.cs +++ b/src/Services/Webhooks/Webhooks.API/Exceptions/WebhooksDomainException.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Webhooks.API.Exceptions { diff --git a/src/Services/Webhooks/Webhooks.API/Infrastructure/HttpGlobalExceptionFilter.cs b/src/Services/Webhooks/Webhooks.API/Infrastructure/HttpGlobalExceptionFilter.cs index 44cc9547a..7bb818879 100644 --- a/src/Services/Webhooks/Webhooks.API/Infrastructure/HttpGlobalExceptionFilter.cs +++ b/src/Services/Webhooks/Webhooks.API/Infrastructure/HttpGlobalExceptionFilter.cs @@ -4,11 +4,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.Linq; using System.Net; -using System.Threading.Tasks; using Webhooks.API.Exceptions; using Webhooks.API.Infrastructure.ActionResult; diff --git a/src/Services/Webhooks/Webhooks.API/Infrastructure/WebhooksContext.cs b/src/Services/Webhooks/Webhooks.API/Infrastructure/WebhooksContext.cs index 88769bc53..f5b9fbf34 100644 --- a/src/Services/Webhooks/Webhooks.API/Infrastructure/WebhooksContext.cs +++ b/src/Services/Webhooks/Webhooks.API/Infrastructure/WebhooksContext.cs @@ -1,9 +1,5 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Webhooks.API.Model; namespace Webhooks.API.Infrastructure diff --git a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToPaidIntegrationEvent.cs b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToPaidIntegrationEvent.cs index 3f532ef0a..0f14dd83e 100644 --- a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToPaidIntegrationEvent.cs +++ b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToPaidIntegrationEvent.cs @@ -1,8 +1,5 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -using System; using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Webhooks.API.IntegrationEvents { diff --git a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToPaidIntegrationEventHandler.cs b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToPaidIntegrationEventHandler.cs index 0b118bb61..338ffa7d3 100644 --- a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToPaidIntegrationEventHandler.cs +++ b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToPaidIntegrationEventHandler.cs @@ -1,11 +1,9 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; -using System; -using System.Collections.Generic; +using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; using Webhooks.API.Model; using Webhooks.API.Services; -using Microsoft.Extensions.Logging; namespace Webhooks.API.IntegrationEvents { @@ -14,7 +12,7 @@ namespace Webhooks.API.IntegrationEvents private readonly IWebhooksRetriever _retriever; private readonly IWebhooksSender _sender; private readonly ILogger _logger; - public OrderStatusChangedToPaidIntegrationEventHandler(IWebhooksRetriever retriever, IWebhooksSender sender, ILogger logger ) + public OrderStatusChangedToPaidIntegrationEventHandler(IWebhooksRetriever retriever, IWebhooksSender sender, ILogger logger) { _retriever = retriever; _sender = sender; diff --git a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToShippedIntegrationEventHandler.cs b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToShippedIntegrationEventHandler.cs index 9e2325d91..7f04e2db2 100644 --- a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToShippedIntegrationEventHandler.cs +++ b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToShippedIntegrationEventHandler.cs @@ -1,11 +1,9 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; -using System; -using System.Collections.Generic; +using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; using Webhooks.API.Model; using Webhooks.API.Services; -using Microsoft.Extensions.Logging; namespace Webhooks.API.IntegrationEvents { @@ -14,7 +12,7 @@ namespace Webhooks.API.IntegrationEvents private readonly IWebhooksRetriever _retriever; private readonly IWebhooksSender _sender; private readonly ILogger _logger; - public OrderStatusChangedToShippedIntegrationEventHandler(IWebhooksRetriever retriever, IWebhooksSender sender, ILogger logger ) + public OrderStatusChangedToShippedIntegrationEventHandler(IWebhooksRetriever retriever, IWebhooksSender sender, ILogger logger) { _retriever = retriever; _sender = sender; diff --git a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/ProductPriceChangedIntegrationEventHandler.cs b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/ProductPriceChangedIntegrationEventHandler.cs index 10e1542c8..044ce3bd3 100644 --- a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/ProductPriceChangedIntegrationEventHandler.cs +++ b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/ProductPriceChangedIntegrationEventHandler.cs @@ -1,7 +1,4 @@ using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; -using System; -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; namespace Webhooks.API.IntegrationEvents diff --git a/src/Services/Webhooks/Webhooks.API/Migrations/20190118091148_Initial.cs b/src/Services/Webhooks/Webhooks.API/Migrations/20190118091148_Initial.cs index dccfe6bb9..06a8a16c1 100644 --- a/src/Services/Webhooks/Webhooks.API/Migrations/20190118091148_Initial.cs +++ b/src/Services/Webhooks/Webhooks.API/Migrations/20190118091148_Initial.cs @@ -1,6 +1,6 @@ -using System; -using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; +using System; namespace Webhooks.API.Migrations { diff --git a/src/Services/Webhooks/Webhooks.API/Model/WebhookData.cs b/src/Services/Webhooks/Webhooks.API/Model/WebhookData.cs index ecf17c65d..40c2cf2f7 100644 --- a/src/Services/Webhooks/Webhooks.API/Model/WebhookData.cs +++ b/src/Services/Webhooks/Webhooks.API/Model/WebhookData.cs @@ -1,8 +1,5 @@ using Newtonsoft.Json; using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Webhooks.API.Model { @@ -12,7 +9,7 @@ namespace Webhooks.API.Model public string Payload { get; } - public string Type { get; } + public string Type { get; } public WebhookData(WebhookType hookType, object data) { diff --git a/src/Services/Webhooks/Webhooks.API/Model/WebhookSubscription.cs b/src/Services/Webhooks/Webhooks.API/Model/WebhookSubscription.cs index 1b2eb48fe..72d726834 100644 --- a/src/Services/Webhooks/Webhooks.API/Model/WebhookSubscription.cs +++ b/src/Services/Webhooks/Webhooks.API/Model/WebhookSubscription.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Webhooks.API.Model { diff --git a/src/Services/Webhooks/Webhooks.API/Model/WebhookType.cs b/src/Services/Webhooks/Webhooks.API/Model/WebhookType.cs index eceb15913..cda3d7316 100644 --- a/src/Services/Webhooks/Webhooks.API/Model/WebhookType.cs +++ b/src/Services/Webhooks/Webhooks.API/Model/WebhookType.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Webhooks.API.Model +namespace Webhooks.API.Model { public enum WebhookType { diff --git a/src/Services/Webhooks/Webhooks.API/Program.cs b/src/Services/Webhooks/Webhooks.API/Program.cs index b7ed97115..85ab12997 100644 --- a/src/Services/Webhooks/Webhooks.API/Program.cs +++ b/src/Services/Webhooks/Webhooks.API/Program.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore; +using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; diff --git a/src/Services/Webhooks/Webhooks.API/Services/IGrantUrlTesterService.cs b/src/Services/Webhooks/Webhooks.API/Services/IGrantUrlTesterService.cs index c78475fb0..c69e41934 100644 --- a/src/Services/Webhooks/Webhooks.API/Services/IGrantUrlTesterService.cs +++ b/src/Services/Webhooks/Webhooks.API/Services/IGrantUrlTesterService.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using System.Threading.Tasks; namespace Webhooks.API.Services { diff --git a/src/Services/Webhooks/Webhooks.API/Services/IWebhooksRetriever.cs b/src/Services/Webhooks/Webhooks.API/Services/IWebhooksRetriever.cs index ed75cfc64..0ae20f03b 100644 --- a/src/Services/Webhooks/Webhooks.API/Services/IWebhooksRetriever.cs +++ b/src/Services/Webhooks/Webhooks.API/Services/IWebhooksRetriever.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using System.Collections.Generic; using System.Threading.Tasks; using Webhooks.API.Model; diff --git a/src/Services/Webhooks/Webhooks.API/Services/IdentityService.cs b/src/Services/Webhooks/Webhooks.API/Services/IdentityService.cs index d52f30646..be1d54570 100644 --- a/src/Services/Webhooks/Webhooks.API/Services/IdentityService.cs +++ b/src/Services/Webhooks/Webhooks.API/Services/IdentityService.cs @@ -6,7 +6,7 @@ namespace Webhooks.API.Services { public class IdentityService : IIdentityService { - private IHttpContextAccessor _context; + private IHttpContextAccessor _context; public IdentityService(IHttpContextAccessor context) { diff --git a/src/Services/Webhooks/Webhooks.API/Services/WebhooksRetriever.cs b/src/Services/Webhooks/Webhooks.API/Services/WebhooksRetriever.cs index 7caa76220..1f7fb3f1c 100644 --- a/src/Services/Webhooks/Webhooks.API/Services/WebhooksRetriever.cs +++ b/src/Services/Webhooks/Webhooks.API/Services/WebhooksRetriever.cs @@ -1,5 +1,4 @@ using Microsoft.EntityFrameworkCore; -using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; diff --git a/src/Services/Webhooks/Webhooks.API/Startup.cs b/src/Services/Webhooks/Webhooks.API/Startup.cs index 5d33dc6dd..f3b3efbb8 100644 --- a/src/Services/Webhooks/Webhooks.API/Startup.cs +++ b/src/Services/Webhooks/Webhooks.API/Startup.cs @@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.AspNetCore.Http; using Microsoft.Azure.ServiceBus; using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; using Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ; @@ -78,7 +77,7 @@ namespace Webhooks.API app.UsePathBase(pathBase); } - + app.UseRouting(); app.UseCors("CorsPolicy"); diff --git a/src/Tests/Services/Application.FunctionalTests/Extensions/HttpClientExtensions.cs b/src/Tests/Services/Application.FunctionalTests/Extensions/HttpClientExtensions.cs index a41ffd3a2..25475462d 100644 --- a/src/Tests/Services/Application.FunctionalTests/Extensions/HttpClientExtensions.cs +++ b/src/Tests/Services/Application.FunctionalTests/Extensions/HttpClientExtensions.cs @@ -1,8 +1,6 @@ using Microsoft.AspNetCore.TestHost; using System; -using System.Collections.Generic; using System.Net.Http; -using System.Text; namespace FunctionalTests.Extensions { diff --git a/src/Tests/Services/Application.FunctionalTests/Middleware/AutoAuthorizeMiddleware.cs b/src/Tests/Services/Application.FunctionalTests/Middleware/AutoAuthorizeMiddleware.cs index d2f8a55f8..d78dcc80d 100644 --- a/src/Tests/Services/Application.FunctionalTests/Middleware/AutoAuthorizeMiddleware.cs +++ b/src/Tests/Services/Application.FunctionalTests/Middleware/AutoAuthorizeMiddleware.cs @@ -1,8 +1,5 @@ using Microsoft.AspNetCore.Http; -using System; -using System.Collections.Generic; using System.Security.Claims; -using System.Text; using System.Threading.Tasks; namespace FunctionalTests.Middleware diff --git a/src/Tests/Services/Application.FunctionalTests/Services/Catalog/CatalogScenariosBase.cs b/src/Tests/Services/Application.FunctionalTests/Services/Catalog/CatalogScenariosBase.cs index ffaef64a3..c5d9ab72d 100644 --- a/src/Tests/Services/Application.FunctionalTests/Services/Catalog/CatalogScenariosBase.cs +++ b/src/Tests/Services/Application.FunctionalTests/Services/Catalog/CatalogScenariosBase.cs @@ -1,15 +1,14 @@ -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; 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.Logging; using Microsoft.Extensions.Options; using System.IO; using System.Reflection; -using Microsoft.Extensions.Configuration; namespace FunctionalTests.Services.Catalog { @@ -28,7 +27,7 @@ namespace FunctionalTests.Services.Catalog .AddEnvironmentVariables(); }).UseStartup(); - var testServer = new TestServer(hostBuilder); + var testServer = new TestServer(hostBuilder); testServer.Host .MigrateDbContext((context, services) => diff --git a/src/Tests/Services/Application.FunctionalTests/Services/IntegrationEventsScenarios.cs b/src/Tests/Services/Application.FunctionalTests/Services/IntegrationEventsScenarios.cs index dd6eef99a..a8bdcd122 100644 --- a/src/Tests/Services/Application.FunctionalTests/Services/IntegrationEventsScenarios.cs +++ b/src/Tests/Services/Application.FunctionalTests/Services/IntegrationEventsScenarios.cs @@ -5,13 +5,12 @@ using Microsoft.eShopOnContainers.Services.Catalog.API.Model; using Microsoft.eShopOnContainers.Services.Catalog.API.ViewModel; using Newtonsoft.Json; using System; -using System.Linq; using System.Collections.Generic; +using System.Linq; +using System.Net.Http; using System.Text; using System.Threading.Tasks; using Xunit; -using System.Net.Http; -using System.Threading; namespace FunctionalTests.Services { @@ -44,8 +43,8 @@ namespace FunctionalTests.Services var oldPrice = itemToModify.UnitPrice; var newPrice = oldPrice + priceModification; var pRes = await catalogClient.PutAsync(CatalogScenariosBase.Put.UpdateCatalogProduct, new StringContent(ChangePrice(itemToModify, newPrice, originalCatalogProducts), UTF8Encoding.UTF8, "application/json")); - - var modifiedCatalogProducts = await GetCatalogAsync(catalogClient); + + var modifiedCatalogProducts = await GetCatalogAsync(catalogClient); var itemUpdated = await GetUpdatedBasketItem(newPrice, itemToModify.ProductId, userId, basketClient); @@ -72,7 +71,7 @@ namespace FunctionalTests.Services BasketItem itemUpdated = null; while (continueLoop && counter < 20) - { + { //get the basket and verify that the price of the modified product is updated var basketGetResponse = await basketClient.GetAsync(BasketScenariosBase.Get.GetBasketByCustomer(userId)); var basketUpdated = JsonConvert.DeserializeObject(await basketGetResponse.Content.ReadAsStringAsync()); @@ -93,7 +92,7 @@ namespace FunctionalTests.Services return itemUpdated; } - private async Task> GetCatalogAsync(HttpClient catalogClient) + private async Task> GetCatalogAsync(HttpClient catalogClient) { var response = await catalogClient.GetAsync(CatalogScenariosBase.Get.Items); var items = await response.Content.ReadAsStringAsync(); diff --git a/src/Tests/Services/Application.FunctionalTests/Services/Ordering/OrderingScenarios.cs b/src/Tests/Services/Application.FunctionalTests/Services/Ordering/OrderingScenarios.cs index cb1fc2526..3a6e1c04b 100644 --- a/src/Tests/Services/Application.FunctionalTests/Services/Ordering/OrderingScenarios.cs +++ b/src/Tests/Services/Application.FunctionalTests/Services/Ordering/OrderingScenarios.cs @@ -15,7 +15,7 @@ using Xunit; namespace FunctionalTests.Services.Ordering { public class OrderingScenarios : OrderingScenariosBase - { + { [Fact] public async Task Cancel_basket_and_check_order_status_cancelled() { @@ -69,7 +69,8 @@ namespace FunctionalTests.Services.Ordering var ordersGetResponse = await orderClient.GetStringAsync(OrderingScenariosBase.Get.Orders); var orders = JsonConvert.DeserializeObject>(ordersGetResponse); - if (orders == null || orders.Count == 0) { + if (orders == null || orders.Count == 0) + { counter++; await Task.Delay(100); continue; @@ -84,9 +85,9 @@ namespace FunctionalTests.Services.Ordering if (IsOrderCreated(order, city)) { break; - } - } - + } + } + return order; } @@ -117,7 +118,7 @@ namespace FunctionalTests.Services.Ordering var order = new OrderDTO() { OrderNumber = orderId - }; + }; return JsonConvert.SerializeObject(order); } @@ -135,7 +136,7 @@ namespace FunctionalTests.Services.Ordering CardExpiration = DateTime.Now.AddYears(1), CardSecurityNumber = "123", CardTypeId = 1, - Buyer = "Buyer", + Buyer = "Buyer", RequestId = Guid.NewGuid() }; @@ -143,4 +144,3 @@ namespace FunctionalTests.Services.Ordering } } } - \ No newline at end of file diff --git a/src/Tests/Services/Application.FunctionalTests/Services/Ordering/OrderingTestsStartup.cs b/src/Tests/Services/Application.FunctionalTests/Services/Ordering/OrderingTestsStartup.cs index 41dd9a989..74708dec0 100644 --- a/src/Tests/Services/Application.FunctionalTests/Services/Ordering/OrderingTestsStartup.cs +++ b/src/Tests/Services/Application.FunctionalTests/Services/Ordering/OrderingTestsStartup.cs @@ -1,11 +1,7 @@ using FunctionalTests.Middleware; using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; using Microsoft.eShopOnContainers.Services.Ordering.API; using Microsoft.Extensions.Configuration; -using System; -using System.Collections.Generic; -using System.Text; namespace FunctionalTests.Services.Ordering { diff --git a/src/Web/WebMVC/AppSettings.cs b/src/Web/WebMVC/AppSettings.cs index dd0c25f1f..17a37b1fc 100644 --- a/src/Web/WebMVC/AppSettings.cs +++ b/src/Web/WebMVC/AppSettings.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Microsoft.eShopOnContainers.WebMVC +namespace Microsoft.eShopOnContainers.WebMVC { public class AppSettings { diff --git a/src/Web/WebMVC/Controllers/CatalogController.cs b/src/Web/WebMVC/Controllers/CatalogController.cs index 9e0859858..0ac5ecacc 100644 --- a/src/Web/WebMVC/Controllers/CatalogController.cs +++ b/src/Web/WebMVC/Controllers/CatalogController.cs @@ -1,10 +1,9 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination; +using Microsoft.AspNetCore.Mvc; using Microsoft.eShopOnContainers.WebMVC.Services; using Microsoft.eShopOnContainers.WebMVC.ViewModels.CatalogViewModels; -using Microsoft.AspNetCore.Http; +using Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination; +using System; +using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.WebMVC.Controllers { @@ -12,10 +11,10 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers { private ICatalogService _catalogSvc; - public CatalogController(ICatalogService catalogSvc) => + public CatalogController(ICatalogService catalogSvc) => _catalogSvc = catalogSvc; - public async Task Index(int? BrandFilterApplied, int? TypesFilterApplied, int? page, [FromQuery]string errorMsg) + public async Task Index(int? BrandFilterApplied, int? TypesFilterApplied, int? page, [FromQuery] string errorMsg) { var itemsPage = 10; var catalog = await _catalogSvc.GetCatalogItems(page ?? 0, itemsPage, BrandFilterApplied, TypesFilterApplied); @@ -30,7 +29,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers { ActualPage = page ?? 0, ItemsPerPage = catalog.Data.Count, - TotalItems = catalog.Count, + TotalItems = catalog.Count, TotalPages = (int)Math.Ceiling(((decimal)catalog.Count / itemsPage)) } }; diff --git a/src/Web/WebMVC/Controllers/OrderManagementController.cs b/src/Web/WebMVC/Controllers/OrderManagementController.cs index 6963c469d..27ad642ba 100644 --- a/src/Web/WebMVC/Controllers/OrderManagementController.cs +++ b/src/Web/WebMVC/Controllers/OrderManagementController.cs @@ -1,13 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Authentication.OpenIdConnect; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using WebMVC.Services.ModelDTOs; using Microsoft.eShopOnContainers.WebMVC.Services; using Microsoft.eShopOnContainers.WebMVC.ViewModels; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Authentication.OpenIdConnect; +using System.Threading.Tasks; +using WebMVC.Services.ModelDTOs; namespace WebMVC.Controllers { @@ -37,7 +34,7 @@ namespace WebMVC.Controllers { await _orderSvc.ShipOrder(orderId); } - + return RedirectToAction("Index"); } } diff --git a/src/Web/WebMVC/Controllers/TestController.cs b/src/Web/WebMVC/Controllers/TestController.cs index 2cf053126..a80fe9ad8 100644 --- a/src/Web/WebMVC/Controllers/TestController.cs +++ b/src/Web/WebMVC/Controllers/TestController.cs @@ -48,7 +48,7 @@ namespace WebMVC.Controllers if (response.IsSuccessStatusCode) { - var str = await response.Content.ReadAsStringAsync(); + var str = await response.Content.ReadAsStringAsync(); return Ok(str); } diff --git a/src/Web/WebMVC/Extensions/HttpClientExtensions.cs b/src/Web/WebMVC/Extensions/HttpClientExtensions.cs index a1d6f215d..087c0dd8a 100644 --- a/src/Web/WebMVC/Extensions/HttpClientExtensions.cs +++ b/src/Web/WebMVC/Extensions/HttpClientExtensions.cs @@ -1,11 +1,8 @@ using System; -using System.Collections.Generic; using System.IdentityModel.Tokens.Jwt; -using System.Linq; using System.Net.Http; using System.Net.Http.Headers; using System.Text; -using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.WebMVC.Extensions { diff --git a/src/Web/WebMVC/Extensions/SessionExtensions.cs b/src/Web/WebMVC/Extensions/SessionExtensions.cs index 79bd435f0..47b079158 100644 --- a/src/Web/WebMVC/Extensions/SessionExtensions.cs +++ b/src/Web/WebMVC/Extensions/SessionExtensions.cs @@ -1,9 +1,5 @@ using Microsoft.AspNetCore.Http; using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; public static class SessionExtensions diff --git a/src/Web/WebMVC/Infrastructure/HttpClientRequestIdDelegatingHandler.cs b/src/Web/WebMVC/Infrastructure/HttpClientRequestIdDelegatingHandler.cs index 37bea4d30..a59c757c0 100644 --- a/src/Web/WebMVC/Infrastructure/HttpClientRequestIdDelegatingHandler.cs +++ b/src/Web/WebMVC/Infrastructure/HttpClientRequestIdDelegatingHandler.cs @@ -22,7 +22,7 @@ namespace WebMVC.Infrastructure request.Headers.Add("x-requestid", Guid.NewGuid().ToString()); } } - + return await base.SendAsync(request, cancellationToken); } } diff --git a/src/Web/WebMVC/Infrastructure/WebContextSeed.cs b/src/Web/WebMVC/Infrastructure/WebContextSeed.cs index ab3b8d801..16696af9d 100644 --- a/src/Web/WebMVC/Infrastructure/WebContextSeed.cs +++ b/src/Web/WebMVC/Infrastructure/WebContextSeed.cs @@ -35,7 +35,7 @@ namespace WebMVC.Infrastructure static void GetPreconfiguredCSS(string contentRootPath, string webroot, ILogger log) { try - { + { string overrideCssFile = Path.Combine(contentRootPath, "Setup", "override.css"); if (!File.Exists(overrideCssFile)) { @@ -44,7 +44,7 @@ namespace WebMVC.Infrastructure } string destinationFilename = Path.Combine(webroot, "css", "override.css"); - File.Copy(overrideCssFile, destinationFilename, true ); + File.Copy(overrideCssFile, destinationFilename, true); } catch (Exception ex) { @@ -86,7 +86,7 @@ namespace WebMVC.Infrastructure } } } - catch ( Exception ex ) + catch (Exception ex) { log.Error(ex, "EXCEPTION ERROR: {Message}", ex.Message); } diff --git a/src/Web/WebMVC/Services/BasketService.cs b/src/Web/WebMVC/Services/BasketService.cs index 64184f7b2..26985a671 100644 --- a/src/Web/WebMVC/Services/BasketService.cs +++ b/src/Web/WebMVC/Services/BasketService.cs @@ -23,7 +23,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services { _apiClient = httpClient; _settings = settings; - _logger =logger; + _logger = logger; _basketByPassUrl = $"{_settings.Value.PurchaseUrl}/b/api/v1/basket"; _purchaseUrl = $"{_settings.Value.PurchaseUrl}/api/v1"; @@ -33,7 +33,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services { var uri = API.Basket.GetBasket(_basketByPassUrl, user.Id); _logger.LogDebug("[GetBasket] -> Calling {Uri} to get the basket", uri); - var response = await _apiClient.GetAsync(uri); + var response = await _apiClient.GetAsync(uri); _logger.LogDebug("[GetBasket] -> response code {StatusCode}", response.StatusCode); var responseString = await response.Content.ReadAsStringAsync(); return string.IsNullOrEmpty(responseString) ? @@ -97,7 +97,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services var responseString = await _apiClient.GetStringAsync(uri); - var response = JsonConvert.DeserializeObject(responseString); + var response = JsonConvert.DeserializeObject(responseString); return response; } diff --git a/src/Web/WebMVC/Services/IBasketService.cs b/src/Web/WebMVC/Services/IBasketService.cs index 8c096bfaf..cc576ec11 100644 --- a/src/Web/WebMVC/Services/IBasketService.cs +++ b/src/Web/WebMVC/Services/IBasketService.cs @@ -1,7 +1,5 @@ using Microsoft.eShopOnContainers.WebMVC.ViewModels; -using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using WebMVC.Services.ModelDTOs; diff --git a/src/Web/WebMVC/Services/ICatalogService.cs b/src/Web/WebMVC/Services/ICatalogService.cs index b126168fd..3879ad13d 100644 --- a/src/Web/WebMVC/Services/ICatalogService.cs +++ b/src/Web/WebMVC/Services/ICatalogService.cs @@ -1,8 +1,6 @@ using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.eShopOnContainers.WebMVC.ViewModels; -using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.WebMVC.Services diff --git a/src/Web/WebMVC/Services/IIdentityParser.cs b/src/Web/WebMVC/Services/IIdentityParser.cs index a4f98c61c..aaf2ab8cd 100644 --- a/src/Web/WebMVC/Services/IIdentityParser.cs +++ b/src/Web/WebMVC/Services/IIdentityParser.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Principal; -using System.Threading.Tasks; +using System.Security.Principal; namespace Microsoft.eShopOnContainers.WebMVC.Services { diff --git a/src/Web/WebMVC/Services/IOrderingService.cs b/src/Web/WebMVC/Services/IOrderingService.cs index 480ea4119..cc1968c53 100644 --- a/src/Web/WebMVC/Services/IOrderingService.cs +++ b/src/Web/WebMVC/Services/IOrderingService.cs @@ -1,7 +1,5 @@ using Microsoft.eShopOnContainers.WebMVC.ViewModels; -using System; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using WebMVC.Services.ModelDTOs; diff --git a/src/Web/WebMVC/Services/IdentityParser.cs b/src/Web/WebMVC/Services/IdentityParser.cs index 70e82e53b..5360ebed4 100644 --- a/src/Web/WebMVC/Services/IdentityParser.cs +++ b/src/Web/WebMVC/Services/IdentityParser.cs @@ -1,14 +1,12 @@ using Microsoft.eShopOnContainers.WebMVC.ViewModels; using System; -using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Security.Principal; -using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.WebMVC.Services { - public class IdentityParser:IIdentityParser + public class IdentityParser : IIdentityParser { public ApplicationUser Parse(IPrincipal principal) { diff --git a/src/Web/WebMVC/Services/ModelDTOs/BasketDTO.cs b/src/Web/WebMVC/Services/ModelDTOs/BasketDTO.cs index bff5ec10b..59b8ea2ca 100644 --- a/src/Web/WebMVC/Services/ModelDTOs/BasketDTO.cs +++ b/src/Web/WebMVC/Services/ModelDTOs/BasketDTO.cs @@ -22,7 +22,7 @@ namespace WebMVC.Services.ModelDTOs [Required] public DateTime CardExpiration { get; init; } - + [Required] public string CardSecurityNumber { get; init; } @@ -31,7 +31,7 @@ namespace WebMVC.Services.ModelDTOs public string Buyer { get; init; } [Required] - public Guid RequestId { get; init; } + public Guid RequestId { get; init; } } } diff --git a/src/Web/WebMVC/Startup.cs b/src/Web/WebMVC/Startup.cs index 07eed0f75..427e234c7 100644 --- a/src/Web/WebMVC/Startup.cs +++ b/src/Web/WebMVC/Startup.cs @@ -18,7 +18,6 @@ using StackExchange.Redis; using System; using System.IdentityModel.Tokens.Jwt; using WebMVC.Infrastructure; -using WebMVC.Services; namespace Microsoft.eShopOnContainers.WebMVC { @@ -42,8 +41,8 @@ namespace Microsoft.eShopOnContainers.WebMVC .AddDevspaces() .AddHttpClientServices(Configuration); - IdentityModelEventSource.ShowPII = true; // Caution! Do NOT use in production: https://aka.ms/IdentityModel/PII - + IdentityModelEventSource.ShowPII = true; // Caution! Do NOT use in production: https://aka.ms/IdentityModel/PII + services.AddControllers(); services.AddCustomAuthentication(Configuration); @@ -73,13 +72,13 @@ namespace Microsoft.eShopOnContainers.WebMVC app.UseSession(); WebContextSeed.Seed(app, env); - + // Fix samesite issue when running eShop from docker-compose locally as by default http protocol is being used // Refer to https://github.com/dotnet-architecture/eShopOnContainers/issues/1391 - app.UseCookiePolicy(new CookiePolicyOptions { MinimumSameSitePolicy = AspNetCore.Http.SameSiteMode.Lax }); + app.UseCookiePolicy(new CookiePolicyOptions { MinimumSameSitePolicy = AspNetCore.Http.SameSiteMode.Lax }); app.UseRouting(); - + app.UseAuthentication(); app.UseAuthorization(); diff --git a/src/Web/WebMVC/ViewComponents/Cart.cs b/src/Web/WebMVC/ViewComponents/Cart.cs index 6cd8bf2d5..0fa004a49 100644 --- a/src/Web/WebMVC/ViewComponents/Cart.cs +++ b/src/Web/WebMVC/ViewComponents/Cart.cs @@ -1,10 +1,7 @@ using Microsoft.AspNetCore.Mvc; +using Microsoft.eShopOnContainers.WebMVC.Services; using Microsoft.eShopOnContainers.WebMVC.ViewModels; using Microsoft.eShopOnContainers.WebMVC.ViewModels.CartViewModels; -using Microsoft.eShopOnContainers.WebMVC.Services; -using System; -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.WebMVC.ViewComponents @@ -24,7 +21,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.ViewComponents vm.ItemsCount = itemsInCart; return View(vm); } - catch + catch { ViewBag.IsBasketInoperative = true; } diff --git a/src/Web/WebMVC/ViewComponents/CartList.cs b/src/Web/WebMVC/ViewComponents/CartList.cs index 88d1f9abb..f572c8437 100644 --- a/src/Web/WebMVC/ViewComponents/CartList.cs +++ b/src/Web/WebMVC/ViewComponents/CartList.cs @@ -1,9 +1,7 @@ using Microsoft.AspNetCore.Mvc; -using Microsoft.eShopOnContainers.WebMVC.ViewModels; using Microsoft.eShopOnContainers.WebMVC.Services; +using Microsoft.eShopOnContainers.WebMVC.ViewModels; using System; -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.WebMVC.ViewComponents @@ -29,7 +27,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.ViewComponents return View(vm); } - + private Task GetItemsAsync(ApplicationUser user) => _cartSvc.GetBasket(user); } } diff --git a/src/Web/WebMVC/ViewModels/Annotations/CardExpiration.cs b/src/Web/WebMVC/ViewModels/Annotations/CardExpiration.cs index d60150a44..3819f6fb0 100644 --- a/src/Web/WebMVC/ViewModels/Annotations/CardExpiration.cs +++ b/src/Web/WebMVC/ViewModels/Annotations/CardExpiration.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.WebMVC.ViewModels.Annotations { @@ -24,7 +21,8 @@ namespace Microsoft.eShopOnContainers.WebMVC.ViewModels.Annotations DateTime d = new DateTime(year, month, 1); return d > DateTime.UtcNow; - } else + } + else { return false; } diff --git a/src/Web/WebMVC/ViewModels/Annotations/LongitudeCoordinate.cs b/src/Web/WebMVC/ViewModels/Annotations/LongitudeCoordinate.cs index de2266711..de1f5cd3e 100644 --- a/src/Web/WebMVC/ViewModels/Annotations/LongitudeCoordinate.cs +++ b/src/Web/WebMVC/ViewModels/Annotations/LongitudeCoordinate.cs @@ -16,7 +16,7 @@ namespace WebMVC.ViewModels.Annotations ("Longitude must be between -180 and 180 degrees inclusive."); } - return ValidationResult.Success; + return ValidationResult.Success; } } } diff --git a/src/Web/WebMVC/ViewModels/ApplicationUser.cs b/src/Web/WebMVC/ViewModels/ApplicationUser.cs index 23016a6db..ec0318850 100644 --- a/src/Web/WebMVC/ViewModels/ApplicationUser.cs +++ b/src/Web/WebMVC/ViewModels/ApplicationUser.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Identity; using System.ComponentModel.DataAnnotations; -using Microsoft.AspNetCore.Identity; namespace Microsoft.eShopOnContainers.WebMVC.ViewModels { diff --git a/src/Web/WebMVC/ViewModels/Basket.cs b/src/Web/WebMVC/ViewModels/Basket.cs index bafb3cbe8..24c4ca30b 100644 --- a/src/Web/WebMVC/ViewModels/Basket.cs +++ b/src/Web/WebMVC/ViewModels/Basket.cs @@ -15,7 +15,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.ViewModels public decimal Total() { - return Math.Round(Items.Sum(x => x.UnitPrice * x.Quantity),2); + return Math.Round(Items.Sum(x => x.UnitPrice * x.Quantity), 2); } } } diff --git a/src/Web/WebMVC/ViewModels/Order.cs b/src/Web/WebMVC/ViewModels/Order.cs index 2beaf43b1..4de37ca00 100644 --- a/src/Web/WebMVC/ViewModels/Order.cs +++ b/src/Web/WebMVC/ViewModels/Order.cs @@ -5,21 +5,19 @@ using System; using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; using WebMVC.Services.ModelDTOs; namespace Microsoft.eShopOnContainers.WebMVC.ViewModels { public class Order { - public string OrderNumber {get;set;} + public string OrderNumber { get; set; } - public DateTime Date {get;set;} + public DateTime Date { get; set; } public string Status { get; set; } - public decimal Total {get;set;} + public decimal Total { get; set; } public string Description { get; set; } diff --git a/src/Web/WebSPA/AppSettings.cs b/src/Web/WebSPA/AppSettings.cs index beeef9d68..7c4b89b3c 100644 --- a/src/Web/WebSPA/AppSettings.cs +++ b/src/Web/WebSPA/AppSettings.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace eShopOnContainers.WebSPA +namespace eShopOnContainers.WebSPA { public class AppSettings { diff --git a/src/Web/WebSPA/Program.cs b/src/Web/WebSPA/Program.cs index 5e329981e..d496cd98d 100644 --- a/src/Web/WebSPA/Program.cs +++ b/src/Web/WebSPA/Program.cs @@ -1,10 +1,10 @@ -using Microsoft.AspNetCore; +using eShopConContainers.WebSPA; +using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; -using System.IO; -using Microsoft.Extensions.Logging; using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; using Serilog; -using eShopConContainers.WebSPA; +using System.IO; BuildWebHost(args).Run(); diff --git a/src/Web/WebSPA/Server/Controllers/HomeController.cs b/src/Web/WebSPA/Server/Controllers/HomeController.cs index 14e8a8871..992cac113 100644 --- a/src/Web/WebSPA/Server/Controllers/HomeController.cs +++ b/src/Web/WebSPA/Server/Controllers/HomeController.cs @@ -1,9 +1,9 @@ // For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 +using eShopOnContainers.WebSPA; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; -using eShopOnContainers.WebSPA; namespace eShopConContainers.WebSPA.Server.Controllers { @@ -20,6 +20,6 @@ namespace eShopConContainers.WebSPA.Server.Controllers public IActionResult Configuration() { return Json(_settings.Value); - } + } } } diff --git a/src/Web/WebSPA/Startup.cs b/src/Web/WebSPA/Startup.cs index 714a79fdd..58258070a 100644 --- a/src/Web/WebSPA/Startup.cs +++ b/src/Web/WebSPA/Startup.cs @@ -70,7 +70,7 @@ namespace eShopConContainers.WebSPA { app.UseDeveloperExceptionPage(); } - + // Configure XSRF middleware, This pattern is for SPA style applications where XSRF token is added on Index page // load and passed back token on every subsequent async request // app.Use(async (context, next) => diff --git a/src/Web/WebStatus/Controllers/HomeController.cs b/src/Web/WebStatus/Controllers/HomeController.cs index e87e655a6..f1673b642 100644 --- a/src/Web/WebStatus/Controllers/HomeController.cs +++ b/src/Web/WebStatus/Controllers/HomeController.cs @@ -1,8 +1,6 @@ -using HealthChecks.UI.Configuration; -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using System.Linq; -using System.Threading.Tasks; namespace WebStatus.Controllers { diff --git a/src/Web/WebhookClient/Controllers/WebhooksReceivedController.cs b/src/Web/WebhookClient/Controllers/WebhooksReceivedController.cs index 7746b6059..985031106 100644 --- a/src/Web/WebhookClient/Controllers/WebhooksReceivedController.cs +++ b/src/Web/WebhookClient/Controllers/WebhooksReceivedController.cs @@ -1,9 +1,6 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -using System; -using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using WebhookClient.Models; @@ -19,7 +16,7 @@ namespace WebhookClient.Controllers private readonly Settings _settings; private readonly ILogger _logger; private readonly IHooksRepository _hooksRepository; - + public WebhooksReceivedController(IOptions settings, ILogger logger, IHooksRepository hooksRepository) { _settings = settings.Value; diff --git a/src/Web/WebhookClient/HeaderNames.cs b/src/Web/WebhookClient/HeaderNames.cs index c84eed123..6a7f57577 100644 --- a/src/Web/WebhookClient/HeaderNames.cs +++ b/src/Web/WebhookClient/HeaderNames.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace WebhookClient +namespace WebhookClient { static class HeaderNames { diff --git a/src/Web/WebhookClient/HttpClientAuthorizationDelegatingHandler.cs b/src/Web/WebhookClient/HttpClientAuthorizationDelegatingHandler.cs index c4333707f..01cc29038 100644 --- a/src/Web/WebhookClient/HttpClientAuthorizationDelegatingHandler.cs +++ b/src/Web/WebhookClient/HttpClientAuthorizationDelegatingHandler.cs @@ -1,8 +1,6 @@ using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Http; -using System; using System.Collections.Generic; -using System.Linq; using System.Net.Http; using System.Net.Http.Headers; using System.Threading; diff --git a/src/Web/WebhookClient/Models/WebHookReceived.cs b/src/Web/WebhookClient/Models/WebHookReceived.cs index 80cc46c4b..124a0529d 100644 --- a/src/Web/WebhookClient/Models/WebHookReceived.cs +++ b/src/Web/WebhookClient/Models/WebHookReceived.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace WebhookClient.Models { diff --git a/src/Web/WebhookClient/Models/WebhookData.cs b/src/Web/WebhookClient/Models/WebhookData.cs index 7172d2aaa..c80a8d980 100644 --- a/src/Web/WebhookClient/Models/WebhookData.cs +++ b/src/Web/WebhookClient/Models/WebhookData.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace WebhookClient.Models { diff --git a/src/Web/WebhookClient/Models/WebhookResponse.cs b/src/Web/WebhookClient/Models/WebhookResponse.cs index 464afe85b..5b1aadd45 100644 --- a/src/Web/WebhookClient/Models/WebhookResponse.cs +++ b/src/Web/WebhookClient/Models/WebhookResponse.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace WebhookClient.Models { diff --git a/src/Web/WebhookClient/Models/WebhookSubscriptionRequest.cs b/src/Web/WebhookClient/Models/WebhookSubscriptionRequest.cs index 4e4ea2b57..c770c27ed 100644 --- a/src/Web/WebhookClient/Models/WebhookSubscriptionRequest.cs +++ b/src/Web/WebhookClient/Models/WebhookSubscriptionRequest.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace WebhookClient.Models +namespace WebhookClient.Models { public class WebhookSubscriptionRequest { diff --git a/src/Web/WebhookClient/Pages/Error.cshtml.cs b/src/Web/WebhookClient/Pages/Error.cshtml.cs index e85ff4111..607d14db1 100644 --- a/src/Web/WebhookClient/Pages/Error.cshtml.cs +++ b/src/Web/WebhookClient/Pages/Error.cshtml.cs @@ -1,10 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; +using System.Diagnostics; namespace WebhookClient.Pages { diff --git a/src/Web/WebhookClient/Pages/Index.cshtml.cs b/src/Web/WebhookClient/Pages/Index.cshtml.cs index 0e3169f08..417913a20 100644 --- a/src/Web/WebhookClient/Pages/Index.cshtml.cs +++ b/src/Web/WebhookClient/Pages/Index.cshtml.cs @@ -1,10 +1,6 @@ -using System; +using Microsoft.AspNetCore.Mvc.RazorPages; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.AspNetCore.Http; using WebhookClient.Models; using WebhookClient.Services; diff --git a/src/Web/WebhookClient/Pages/Privacy.cshtml.cs b/src/Web/WebhookClient/Pages/Privacy.cshtml.cs index 96aff0e9e..8976468a9 100644 --- a/src/Web/WebhookClient/Pages/Privacy.cshtml.cs +++ b/src/Web/WebhookClient/Pages/Privacy.cshtml.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.AspNetCore.Mvc.RazorPages; namespace WebhookClient.Pages { diff --git a/src/Web/WebhookClient/Pages/RegisterWebhook.cshtml.cs b/src/Web/WebhookClient/Pages/RegisterWebhook.cshtml.cs index 3e52cda27..8ff384b41 100644 --- a/src/Web/WebhookClient/Pages/RegisterWebhook.cshtml.cs +++ b/src/Web/WebhookClient/Pages/RegisterWebhook.cshtml.cs @@ -1,16 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Net.Http; -using System.Net.Http.Formatting; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.Options; using Newtonsoft.Json; +using System.Net; +using System.Net.Http; +using System.Net.Http.Formatting; +using System.Threading.Tasks; using WebhookClient.Models; namespace WebhookClient.Pages diff --git a/src/Web/WebhookClient/Pages/WebhooksList.cshtml.cs b/src/Web/WebhookClient/Pages/WebhooksList.cshtml.cs index 7a523c644..c1c8c8012 100644 --- a/src/Web/WebhookClient/Pages/WebhooksList.cshtml.cs +++ b/src/Web/WebhookClient/Pages/WebhooksList.cshtml.cs @@ -1,9 +1,6 @@ -using System; +using Microsoft.AspNetCore.Mvc.RazorPages; using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; using WebhookClient.Models; using WebhookClient.Services; diff --git a/src/Web/WebhookClient/Services/IHooksRepository.cs b/src/Web/WebhookClient/Services/IHooksRepository.cs index 35d6d73e7..73e89e819 100644 --- a/src/Web/WebhookClient/Services/IHooksRepository.cs +++ b/src/Web/WebhookClient/Services/IHooksRepository.cs @@ -1,6 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; +using System.Collections.Generic; using System.Threading.Tasks; using WebhookClient.Models; diff --git a/src/Web/WebhookClient/Services/InMemoryHooksRepository.cs b/src/Web/WebhookClient/Services/InMemoryHooksRepository.cs index 557aa707b..35bcd2bad 100644 --- a/src/Web/WebhookClient/Services/InMemoryHooksRepository.cs +++ b/src/Web/WebhookClient/Services/InMemoryHooksRepository.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using WebhookClient.Models; diff --git a/src/Web/WebhookClient/Services/WebhooksClient.cs b/src/Web/WebhookClient/Services/WebhooksClient.cs index 379c003ad..3293f282d 100644 --- a/src/Web/WebhookClient/Services/WebhooksClient.cs +++ b/src/Web/WebhookClient/Services/WebhooksClient.cs @@ -1,6 +1,5 @@ using Microsoft.Extensions.Options; using Newtonsoft.Json; -using System; using System.Collections.Generic; using System.Net.Http; using System.Threading.Tasks; diff --git a/src/Web/WebhookClient/Settings.cs b/src/Web/WebhookClient/Settings.cs index 213d272e4..3077d91b0 100644 --- a/src/Web/WebhookClient/Settings.cs +++ b/src/Web/WebhookClient/Settings.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace WebhookClient +namespace WebhookClient { public class Settings {