From 6824c1cb4c7be55d3434bba628820c662acba260 Mon Sep 17 00:00:00 2001 From: Sumit Ghosh Date: Mon, 14 Dec 2020 18:50:22 +0530 Subject: [PATCH 01/14] Updated ini package in package-lock.json file. (#1541) --- src/Web/WebSPA/package-lock.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Web/WebSPA/package-lock.json b/src/Web/WebSPA/package-lock.json index e6c9ae748..717917b9a 100644 --- a/src/Web/WebSPA/package-lock.json +++ b/src/Web/WebSPA/package-lock.json @@ -657,7 +657,7 @@ "optional": true }, "ini": { - "version": "1.3.5", + "version": "1.3.7", "bundled": true, "dev": true, "optional": true @@ -2538,7 +2538,7 @@ "optional": true }, "ini": { - "version": "1.3.5", + "version": "1.3.7", "bundled": true, "dev": true, "optional": true @@ -8837,9 +8837,9 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", + "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==", "dev": true }, "inquirer": { @@ -10712,7 +10712,7 @@ "optional": true }, "ini": { - "version": "1.3.5", + "version": "1.3.7", "bundled": true, "dev": true, "optional": true @@ -15529,7 +15529,7 @@ "optional": true }, "ini": { - "version": "1.3.5", + "version": "1.3.7", "bundled": true, "dev": true, "optional": true @@ -16502,7 +16502,7 @@ "optional": true }, "ini": { - "version": "1.3.5", + "version": "1.3.7", "bundled": true, "optional": true }, From b50296428b1d39cfc570d28e06e1ec6ccc7ffb1e Mon Sep 17 00:00:00 2001 From: Gur Galler <35164039+GurGaller@users.noreply.github.com> Date: Wed, 16 Dec 2020 12:30:29 +0200 Subject: [PATCH 02/14] Removed unnecessary await (#1546) --- .../Ordering.BackgroundTasks/Tasks/GracePeriodManagerTask.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Tasks/GracePeriodManagerTask.cs b/src/Services/Ordering/Ordering.BackgroundTasks/Tasks/GracePeriodManagerTask.cs index 247ed9d67..d921a1178 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Tasks/GracePeriodManagerTask.cs +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Tasks/GracePeriodManagerTask.cs @@ -41,8 +41,6 @@ namespace Ordering.BackgroundTasks.Tasks } _logger.LogDebug("GracePeriodManagerService background task is stopping."); - - await Task.CompletedTask; } private void CheckConfirmedGracePeriodOrders() From 716aca6779d90c54a0d9e18f51af6d2ab9892e33 Mon Sep 17 00:00:00 2001 From: Viswanatha Swamy Date: Thu, 17 Dec 2020 16:20:22 +0530 Subject: [PATCH 03/14] 1. remove unused using, 2. Reorganized the using, 3. Moved the class into separate file and 4. Added line and spacing formats (#1532) * Removed Unused Using and Reorganized the Using * Removed unused using, Reorganized using, moved the class to separate file, removed commented code in Catalog.API * Revert "Removed unused using, Reorganized using, moved the class to separate file, removed commented code in Catalog.API" This reverts commit 34241c430619b3b0bbeaabafa44c078c859237c4. * Removed unused using and reorganized the using inside "Services" folder * Removed Unused using and reoganized the using * Refactor Webhooks.API * Removed unused using and reorganized using inside Catalog.API --- .../AuthorizationHeaderParameterOperationFilter.cs | 1 - .../Basket/Basket.API/Controllers/BasketController.cs | 1 - src/Services/Basket/Basket.API/Grpc/BasketService.cs | 1 - .../Middlewares/ByPassAuthMiddleware.cs | 1 - src/Services/Basket/Basket.API/Startup.cs | 4 +--- .../Catalog.API/Extensions/CatalogItemExtensions.cs | 7 +------ .../Catalog/Catalog.API/Extensions/HostExtensions.cs | 7 ++----- .../Catalog.API/Extensions/WebHostExtensions.cs | 6 +++--- .../Catalog/Catalog.API/Grpc/CatalogService.cs | 11 +++++------ .../Catalog.API/Infrastructure/CatalogContext.cs | 4 ++-- .../CatalogIntegrationEventService.cs | 2 -- ...ngedToAwaitingValidationIntegrationEventHandler.cs | 10 +++++----- ...OrderStatusChangedToPaidIntegrationEventHandler.cs | 2 +- src/Services/Catalog/Catalog.API/Program.cs | 5 +---- src/Services/Catalog/Catalog.API/Startup.cs | 1 - .../Exceptions/WebhooksDomainException.cs | 3 --- .../Infrastructure/HttpGlobalExceptionFilter.cs | 4 ---- .../Webhooks.API/Infrastructure/WebhooksContext.cs | 4 ---- .../OrderStatusChangedToPaidIntegrationEvent.cs | 3 --- ...OrderStatusChangedToPaidIntegrationEventHandler.cs | 4 +--- .../OrderStatusChangedToShippedIntegrationEvent.cs | 4 ---- ...erStatusChangedToShippedIntegrationEventHandler.cs | 4 +--- .../ProductPriceChangedIntegrationEvent.cs | 4 ---- .../ProductPriceChangedIntegrationEventHandler.cs | 3 --- .../Webhooks/Webhooks.API/Model/WebhookData.cs | 3 --- .../Webhooks.API/Model/WebhookSubscription.cs | 3 --- .../Webhooks/Webhooks.API/Model/WebhookType.cs | 7 +------ src/Services/Webhooks/Webhooks.API/Program.cs | 7 +------ .../Webhooks.API/Services/IGrantUrlTesterService.cs | 5 +---- .../Webhooks.API/Services/IWebhooksRetriever.cs | 4 +--- .../Webhooks.API/Services/WebhooksRetriever.cs | 1 - .../Extensions/HttpClientExtensions.cs | 2 -- .../Middleware/AutoAuthorizeMiddleware.cs | 3 --- .../Services/Catalog/CatalogScenariosBase.cs | 5 ++--- .../Services/IntegrationEventsScenarios.cs | 5 ++--- .../Services/Location/LocationsScenariosBase.cs | 1 - .../Services/Location/LocationsTestsStartup.cs | 1 - .../Services/Marketing/CampaignScenariosBase.cs | 2 -- .../Services/Marketing/MarketingScenarios.cs | 9 +++------ .../Services/Marketing/MarketingScenariosBase.cs | 5 ++--- .../Services/Ordering/OrderingTestsStartup.cs | 4 ---- 41 files changed, 36 insertions(+), 127 deletions(-) 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..f51dbdb59 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; 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/ByPassAuthMiddleware.cs b/src/Services/Basket/Basket.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs index 2f5eb28b6..b3f42c14e 100644 --- a/src/Services/Basket/Basket.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs +++ b/src/Services/Basket/Basket.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs @@ -1,7 +1,6 @@ using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Primitives; using System; -using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs index e8576b238..eb29c12ca 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -4,6 +4,7 @@ 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 +34,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 { 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..cee4b5e33 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 { diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs index 3e7ba9868..6c4839297 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs @@ -1,5 +1,4 @@ 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; @@ -7,7 +6,6 @@ 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; diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs index 493a271cc..d7da9951e 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs @@ -1,15 +1,15 @@ 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 : IIntegrationEventHandler diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs index 7d383254f..1a8836186 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs @@ -1,11 +1,11 @@ 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 : IIntegrationEventHandler diff --git a/src/Services/Catalog/Catalog.API/Program.cs b/src/Services/Catalog/Catalog.API/Program.cs index 3632609b4..b737d0142 100644 --- a/src/Services/Catalog/Catalog.API/Program.cs +++ b/src/Services/Catalog/Catalog.API/Program.cs @@ -1,5 +1,4 @@ -using Autofac.Extensions.DependencyInjection; -using Catalog.API.Extensions; +using Catalog.API.Extensions; using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Server.Kestrel.Core; @@ -12,9 +11,7 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Serilog; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Net; namespace Microsoft.eShopOnContainers.Services.Catalog.API diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index 836b6a7b8..2b7082e25 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; 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 c4adda56e..256d60d5a 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..5b59c9401 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 { diff --git a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToShippedIntegrationEvent.cs b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToShippedIntegrationEvent.cs index 10693eb8b..0e678835c 100644 --- a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToShippedIntegrationEvent.cs +++ b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/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 Webhooks.API.IntegrationEvents { diff --git a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToShippedIntegrationEventHandler.cs b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/OrderStatusChangedToShippedIntegrationEventHandler.cs index 9e2325d91..9981d97bd 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 { diff --git a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/ProductPriceChangedIntegrationEvent.cs b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/ProductPriceChangedIntegrationEvent.cs index 18821f9fc..39fba6426 100644 --- a/src/Services/Webhooks/Webhooks.API/IntegrationEvents/ProductPriceChangedIntegrationEvent.cs +++ b/src/Services/Webhooks/Webhooks.API/IntegrationEvents/ProductPriceChangedIntegrationEvent.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 Webhooks.API.IntegrationEvents { 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/Model/WebhookData.cs b/src/Services/Webhooks/Webhooks.API/Model/WebhookData.cs index ecf17c65d..e0ec8caab 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 { 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 b08a1c2da..590d2b335 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/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/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 65206db4f..bce9cc751 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..96d625b72 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 { diff --git a/src/Tests/Services/Application.FunctionalTests/Services/IntegrationEventsScenarios.cs b/src/Tests/Services/Application.FunctionalTests/Services/IntegrationEventsScenarios.cs index dd6eef99a..ff06ad78f 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 { diff --git a/src/Tests/Services/Application.FunctionalTests/Services/Location/LocationsScenariosBase.cs b/src/Tests/Services/Application.FunctionalTests/Services/Location/LocationsScenariosBase.cs index 4c3bd1b29..7c340ce5e 100644 --- a/src/Tests/Services/Application.FunctionalTests/Services/Location/LocationsScenariosBase.cs +++ b/src/Tests/Services/Application.FunctionalTests/Services/Location/LocationsScenariosBase.cs @@ -1,6 +1,5 @@ namespace FunctionalTests.Services.Locations { - using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; using Microsoft.Extensions.Configuration; diff --git a/src/Tests/Services/Application.FunctionalTests/Services/Location/LocationsTestsStartup.cs b/src/Tests/Services/Application.FunctionalTests/Services/Location/LocationsTestsStartup.cs index 709c4e7eb..b86d72041 100644 --- a/src/Tests/Services/Application.FunctionalTests/Services/Location/LocationsTestsStartup.cs +++ b/src/Tests/Services/Application.FunctionalTests/Services/Location/LocationsTestsStartup.cs @@ -1,7 +1,6 @@ namespace FunctionalTests.Services.Locations { using Microsoft.AspNetCore.Builder; - using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.eShopOnContainers.Services.Locations.API; using Microsoft.Extensions.Configuration; diff --git a/src/Tests/Services/Application.FunctionalTests/Services/Marketing/CampaignScenariosBase.cs b/src/Tests/Services/Application.FunctionalTests/Services/Marketing/CampaignScenariosBase.cs index ab21dccba..447067dd4 100644 --- a/src/Tests/Services/Application.FunctionalTests/Services/Marketing/CampaignScenariosBase.cs +++ b/src/Tests/Services/Application.FunctionalTests/Services/Marketing/CampaignScenariosBase.cs @@ -1,7 +1,5 @@ namespace FunctionalTests.Services.Marketing { - using System; - public class CampaignScenariosBase : MarketingScenariosBase { public static class Get diff --git a/src/Tests/Services/Application.FunctionalTests/Services/Marketing/MarketingScenarios.cs b/src/Tests/Services/Application.FunctionalTests/Services/Marketing/MarketingScenarios.cs index 4c808565b..b0ecfd725 100644 --- a/src/Tests/Services/Application.FunctionalTests/Services/Marketing/MarketingScenarios.cs +++ b/src/Tests/Services/Application.FunctionalTests/Services/Marketing/MarketingScenarios.cs @@ -1,17 +1,14 @@ namespace FunctionalTests.Services.Marketing { - using UserLocation = Microsoft.eShopOnContainers.Services.Locations.API.Model.UserLocation; - using LocationRequest = Microsoft.eShopOnContainers.Services.Locations.API.ViewModel.LocationRequest; using FunctionalTests.Services.Locations; + using Microsoft.eShopOnContainers.Services.Marketing.API.Dto; using Newtonsoft.Json; - using System; + using System.Collections.Generic; using System.Net.Http; using System.Text; using System.Threading.Tasks; using Xunit; - using System.Collections.Generic; - using Microsoft.eShopOnContainers.Services.Marketing.API.Dto; - using Microsoft.eShopOnContainers.Services.Catalog.API.ViewModel; + using LocationRequest = Microsoft.eShopOnContainers.Services.Locations.API.ViewModel.LocationRequest; public class MarketingScenarios : MarketingScenariosBase { diff --git a/src/Tests/Services/Application.FunctionalTests/Services/Marketing/MarketingScenariosBase.cs b/src/Tests/Services/Application.FunctionalTests/Services/Marketing/MarketingScenariosBase.cs index 63b9214b2..9a70c875d 100644 --- a/src/Tests/Services/Application.FunctionalTests/Services/Marketing/MarketingScenariosBase.cs +++ b/src/Tests/Services/Application.FunctionalTests/Services/Marketing/MarketingScenariosBase.cs @@ -1,12 +1,11 @@ -using Microsoft.AspNetCore; -using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.TestHost; using Microsoft.eShopOnContainers.Services.Marketing.API.Infrastructure; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using System.IO; using System.Reflection; -using Microsoft.Extensions.Configuration; namespace FunctionalTests.Services.Marketing { diff --git a/src/Tests/Services/Application.FunctionalTests/Services/Ordering/OrderingTestsStartup.cs b/src/Tests/Services/Application.FunctionalTests/Services/Ordering/OrderingTestsStartup.cs index 46e5fe8c1..02a14759e 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 { From 0c575b5799c977bf0c379e8949af39f19eb067c6 Mon Sep 17 00:00:00 2001 From: Viswanatha Swamy Date: Fri, 18 Dec 2020 11:52:45 +0530 Subject: [PATCH 04/14] Swamy/remove unused using and refactor the code (#1552) * Removed Unused Using and Reorganized the Using * Removed unused using, Reorganized using, moved the class to separate file, removed commented code in Catalog.API * Revert "Removed unused using, Reorganized using, moved the class to separate file, removed commented code in Catalog.API" This reverts commit 34241c430619b3b0bbeaabafa44c078c859237c4. * Removed unused using and reorganized the using inside "Services" folder * Removed Unused using and reoganized the using * Refactor Webhooks.API * Removed unused using and reorganized using inside Catalog.API * Refactoring * Removed unsed using * Added line break just to differentiate between the messages --- src/Services/Catalog/Catalog.API/CatalogSettings.cs | 3 ++- .../Events/OrderStatusChangedToPaidIntegrationEvent.cs | 2 +- src/Services/Catalog/Catalog.API/Proto/catalog.proto | 1 + .../Catalog/Catalog.FunctionalTests/CatalogScenarioBase.cs | 1 - 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Services/Catalog/Catalog.API/CatalogSettings.cs b/src/Services/Catalog/Catalog.API/CatalogSettings.cs index a8c47991e..3bff82f3f 100644 --- a/src/Services/Catalog/Catalog.API/CatalogSettings.cs +++ b/src/Services/Catalog/Catalog.API/CatalogSettings.cs @@ -7,6 +7,7 @@ public string EventBusConnection { get; set; } public bool UseCustomizationData { get; set; } - public bool AzureStorageEnabled { get; set; } + + public bool AzureStorageEnabled { get; set; } } } diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/OrderStatusChangedToPaidIntegrationEvent.cs index 881aa21fe..b338690ae 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 class OrderStatusChangedToPaidIntegrationEvent : IntegrationEvent { diff --git a/src/Services/Catalog/Catalog.API/Proto/catalog.proto b/src/Services/Catalog/Catalog.API/Proto/catalog.proto index fa83d45c4..cac5895dc 100644 --- a/src/Services/Catalog/Catalog.API/Proto/catalog.proto +++ b/src/Services/Catalog/Catalog.API/Proto/catalog.proto @@ -10,6 +10,7 @@ package CatalogApi; message CatalogItemRequest { int32 id = 1; } + message CatalogItemsRequest { string ids = 1; int32 pageSize = 2; 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; From 811874b76a98e649ad913347e0043397a4291419 Mon Sep 17 00:00:00 2001 From: Viswanatha Swamy Date: Wed, 23 Dec 2020 15:19:36 +0530 Subject: [PATCH 05/14] Swamy/remove unused using and refactor the code (#1555) * Removed Unused Using and Reorganized the Using * Removed unused using, Reorganized using, moved the class to separate file, removed commented code in Catalog.API * Revert "Removed unused using, Reorganized using, moved the class to separate file, removed commented code in Catalog.API" This reverts commit 34241c430619b3b0bbeaabafa44c078c859237c4. * Removed unused using and reorganized the using inside "Services" folder * Removed Unused using and reoganized the using * Refactor Webhooks.API * Removed unused using and reorganized using inside Catalog.API * Refactoring * Removed unsed using * Added line break just to differentiate between the messages * Removed unused usings * Simple Refactoring --- .../Services/Catalog/CatalogScenariosBase.cs | 2 +- .../Services/IntegrationEventsScenarios.cs | 8 ++++---- .../Marketing/UserLocationRoleScenariosBase.cs | 2 +- .../Services/Ordering/OrderingScenarios.cs | 16 ++++++++-------- src/Web/WebMVC/AppSettings.cs | 7 +------ .../WebMVC/Controllers/CampaignsController.cs | 8 ++++---- src/Web/WebMVC/Controllers/CatalogController.cs | 15 +++++++-------- .../Controllers/OrderManagementController.cs | 13 +++++-------- src/Web/WebMVC/Controllers/TestController.cs | 2 +- .../WebMVC/Extensions/HttpClientExtensions.cs | 3 --- src/Web/WebMVC/Extensions/SessionExtensions.cs | 4 ---- .../HttpClientRequestIdDelegatingHandler.cs | 2 +- .../Middlewares/ByPassAuthMiddleware.cs | 3 +-- src/Web/WebMVC/Infrastructure/WebContextSeed.cs | 6 +++--- src/Web/WebMVC/Program.cs | 10 ++++++---- src/Web/WebMVC/Services/BasketService.cs | 6 +++--- src/Web/WebMVC/Services/IBasketService.cs | 2 -- src/Web/WebMVC/Services/ICampaignService.cs | 1 - 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 +--- src/Web/WebMVC/Services/ModelDTOs/BasketDTO.cs | 4 ++-- src/Web/WebMVC/Startup.cs | 13 +++++-------- 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 | 3 +-- src/Web/WebMVC/ViewModels/BasketItem.cs | 7 +------ .../CampaignViewModel/CampaignViewModel.cs | 4 ++-- .../ViewModels/CartViewModels/IndexViewModel.cs | 8 +------- src/Web/WebMVC/ViewModels/Catalog.cs | 5 +---- src/Web/WebMVC/ViewModels/CatalogItem.cs | 4 +--- .../CatalogViewModels/IndexViewModel.cs | 3 --- src/Web/WebMVC/ViewModels/Header.cs | 4 +--- src/Web/WebMVC/ViewModels/Order.cs | 8 +++----- src/Web/WebMVC/ViewModels/OrderItem.cs | 7 +------ .../ViewModels/Pagination/PaginationInfo.cs | 7 +------ src/Web/WebSPA/AppSettings.cs | 7 +------ src/Web/WebSPA/Program.cs | 6 +++--- .../WebSPA/Server/Controllers/HomeController.cs | 4 ++-- src/Web/WebSPA/Startup.cs | 2 +- src/Web/WebStatus/Controllers/HomeController.cs | 4 +--- 45 files changed, 84 insertions(+), 167 deletions(-) diff --git a/src/Tests/Services/Application.FunctionalTests/Services/Catalog/CatalogScenariosBase.cs b/src/Tests/Services/Application.FunctionalTests/Services/Catalog/CatalogScenariosBase.cs index 96d625b72..c5d9ab72d 100644 --- a/src/Tests/Services/Application.FunctionalTests/Services/Catalog/CatalogScenariosBase.cs +++ b/src/Tests/Services/Application.FunctionalTests/Services/Catalog/CatalogScenariosBase.cs @@ -27,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 ff06ad78f..a8bdcd122 100644 --- a/src/Tests/Services/Application.FunctionalTests/Services/IntegrationEventsScenarios.cs +++ b/src/Tests/Services/Application.FunctionalTests/Services/IntegrationEventsScenarios.cs @@ -43,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); @@ -71,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()); @@ -92,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/Marketing/UserLocationRoleScenariosBase.cs b/src/Tests/Services/Application.FunctionalTests/Services/Marketing/UserLocationRoleScenariosBase.cs index 20beeef48..3949d5f87 100644 --- a/src/Tests/Services/Application.FunctionalTests/Services/Marketing/UserLocationRoleScenariosBase.cs +++ b/src/Tests/Services/Application.FunctionalTests/Services/Marketing/UserLocationRoleScenariosBase.cs @@ -15,7 +15,7 @@ public static class Post { - public static string AddNewuserLocationRule(int campaignId) + public static string AddNewuserLocationRule(int campaignId) => GetUserLocationRolesUrlBase(campaignId); } 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/Web/WebMVC/AppSettings.cs b/src/Web/WebMVC/AppSettings.cs index a705c5a90..dacb92adc 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/CampaignsController.cs b/src/Web/WebMVC/Controllers/CampaignsController.cs index 920269467..ff98850db 100644 --- a/src/Web/WebMVC/Controllers/CampaignsController.cs +++ b/src/Web/WebMVC/Controllers/CampaignsController.cs @@ -2,16 +2,16 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers { using AspNetCore.Authorization; using AspNetCore.Mvc; - using global::WebMVC.Services.ModelDTOs; using global::WebMVC.Services; + using global::WebMVC.Services.ModelDTOs; using global::WebMVC.ViewModels; + using Microsoft.AspNetCore.Authentication.OpenIdConnect; using Microsoft.Extensions.Options; using Services; using System; using System.Threading.Tasks; using ViewModels; using ViewModels.Pagination; - using Microsoft.AspNetCore.Authentication.OpenIdConnect; [Authorize(AuthenticationSchemes = OpenIdConnectDefaults.AuthenticationScheme)] public class CampaignsController : Controller @@ -31,12 +31,12 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers { var campaignList = await _campaignService.GetCampaigns(pageSize, page); - if(campaignList is null) + if (campaignList is null) { return View(); } - var totalPages = (int) Math.Ceiling((decimal) campaignList.Count / pageSize); + var totalPages = (int)Math.Ceiling((decimal)campaignList.Count / pageSize); var vm = new CampaignViewModel { 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/Middlewares/ByPassAuthMiddleware.cs b/src/Web/WebMVC/Infrastructure/Middlewares/ByPassAuthMiddleware.cs index 4661aa13c..dd56c28e2 100644 --- a/src/Web/WebMVC/Infrastructure/Middlewares/ByPassAuthMiddleware.cs +++ b/src/Web/WebMVC/Infrastructure/Middlewares/ByPassAuthMiddleware.cs @@ -1,7 +1,6 @@ using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Primitives; using System; -using System.Collections.Generic; using System.Linq; using System.Security.Claims; using System.Threading.Tasks; @@ -63,7 +62,7 @@ namespace WebMVC.Infrastructure.Middlewares new Claim("name", "Test user"), new Claim("nonce", Guid.NewGuid().ToString()), new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", "Test user"), - new Claim("http://schemas.microsoft.com/identity/claims/identityprovider", "ByPassAuthMiddleware"), + new Claim("http://schemas.microsoft.com/identity/claims/identityprovider", "ByPassAuthMiddleware"), new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname","User"), new Claim("sub", currentUserId), new Claim("card_expiration", "12/21"), 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/Program.cs b/src/Web/WebMVC/Program.cs index eb99cd42e..36292dca8 100644 --- a/src/Web/WebMVC/Program.cs +++ b/src/Web/WebMVC/Program.cs @@ -42,13 +42,13 @@ namespace Microsoft.eShopOnContainers.WebMVC private static IWebHost BuildWebHost(IConfiguration configuration, string[] args) => WebHost.CreateDefaultBuilder(args) - .CaptureStartupErrors(false) + .CaptureStartupErrors(false) .ConfigureAppConfiguration(x => x.AddConfiguration(configuration)) .UseStartup() .UseSerilog() .Build(); - private static Serilog.ILogger CreateSerilogLogger(IConfiguration configuration) + private static Serilog.ILogger CreateSerilogLogger(IConfiguration configuration) { var seqServerUrl = configuration["Serilog:SeqServerUrl"]; var logstashUrl = configuration["Serilog:LogstashgUrl"]; @@ -57,10 +57,12 @@ namespace Microsoft.eShopOnContainers.WebMVC .Enrich.WithProperty("ApplicationContext", AppName) .Enrich.FromLogContext() .WriteTo.Console(); - if (!string.IsNullOrWhiteSpace(seqServerUrl)) { + if (!string.IsNullOrWhiteSpace(seqServerUrl)) + { cfg.WriteTo.Seq(seqServerUrl); } - if (!string.IsNullOrWhiteSpace(logstashUrl)) { + if (!string.IsNullOrWhiteSpace(logstashUrl)) + { cfg.WriteTo.Http(logstashUrl); } return cfg.CreateLogger(); 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/ICampaignService.cs b/src/Web/WebMVC/Services/ICampaignService.cs index ab80e930a..c12a3ae01 100644 --- a/src/Web/WebMVC/Services/ICampaignService.cs +++ b/src/Web/WebMVC/Services/ICampaignService.cs @@ -1,6 +1,5 @@ namespace Microsoft.eShopOnContainers.WebMVC.Services { - using System.Collections.Generic; using System.Threading.Tasks; using ViewModels; 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 130a729f5..246991058 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; set; } - + [Required] public string CardSecurityNumber { get; set; } @@ -31,7 +31,7 @@ namespace WebMVC.Services.ModelDTOs public string Buyer { get; set; } [Required] - public Guid RequestId { get; set; } + public Guid RequestId { get; set; } } } diff --git a/src/Web/WebMVC/Startup.cs b/src/Web/WebMVC/Startup.cs index e438e9d6c..ccae68a09 100644 --- a/src/Web/WebMVC/Startup.cs +++ b/src/Web/WebMVC/Startup.cs @@ -7,19 +7,16 @@ using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; using Microsoft.eShopOnContainers.WebMVC.Services; using Microsoft.eShopOnContainers.WebMVC.ViewModels; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Diagnostics.HealthChecks; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; using Microsoft.IdentityModel.Logging; using StackExchange.Redis; using System; using System.IdentityModel.Tokens.Jwt; -using System.Net.Http; using WebMVC.Infrastructure; using WebMVC.Infrastructure.Middlewares; using WebMVC.Services; @@ -46,8 +43,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); @@ -82,13 +79,13 @@ namespace Microsoft.eShopOnContainers.WebMVC } 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 b95a910a2..cf9bdcb08 100644 --- a/src/Web/WebMVC/ViewModels/Basket.cs +++ b/src/Web/WebMVC/ViewModels/Basket.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.WebMVC.ViewModels { @@ -16,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/BasketItem.cs b/src/Web/WebMVC/ViewModels/BasketItem.cs index ab767f8f5..2703b6def 100644 --- a/src/Web/WebMVC/ViewModels/BasketItem.cs +++ b/src/Web/WebMVC/ViewModels/BasketItem.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Microsoft.eShopOnContainers.WebMVC.ViewModels +namespace Microsoft.eShopOnContainers.WebMVC.ViewModels { public class BasketItem { diff --git a/src/Web/WebMVC/ViewModels/CampaignViewModel/CampaignViewModel.cs b/src/Web/WebMVC/ViewModels/CampaignViewModel/CampaignViewModel.cs index 80018202f..e67bf27d0 100644 --- a/src/Web/WebMVC/ViewModels/CampaignViewModel/CampaignViewModel.cs +++ b/src/Web/WebMVC/ViewModels/CampaignViewModel/CampaignViewModel.cs @@ -1,11 +1,11 @@ namespace WebMVC.ViewModels { - using System.Collections.Generic; using Microsoft.eShopOnContainers.WebMVC.ViewModels; using Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination; - using WebMVC.ViewModels.Annotations; using Newtonsoft.Json; + using System.Collections.Generic; using System.ComponentModel.DataAnnotations; + using WebMVC.ViewModels.Annotations; public class CampaignViewModel { diff --git a/src/Web/WebMVC/ViewModels/CartViewModels/IndexViewModel.cs b/src/Web/WebMVC/ViewModels/CartViewModels/IndexViewModel.cs index 9a8802542..be7d6dd1f 100644 --- a/src/Web/WebMVC/ViewModels/CartViewModels/IndexViewModel.cs +++ b/src/Web/WebMVC/ViewModels/CartViewModels/IndexViewModel.cs @@ -1,10 +1,4 @@ -using Microsoft.AspNetCore.Mvc.Rendering; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Microsoft.eShopOnContainers.WebMVC.ViewModels.CartViewModels +namespace Microsoft.eShopOnContainers.WebMVC.ViewModels.CartViewModels { public class CartComponentViewModel { diff --git a/src/Web/WebMVC/ViewModels/Catalog.cs b/src/Web/WebMVC/ViewModels/Catalog.cs index d36968565..9624c51c2 100644 --- a/src/Web/WebMVC/ViewModels/Catalog.cs +++ b/src/Web/WebMVC/ViewModels/Catalog.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using System.Collections.Generic; namespace Microsoft.eShopOnContainers.WebMVC.ViewModels { diff --git a/src/Web/WebMVC/ViewModels/CatalogItem.cs b/src/Web/WebMVC/ViewModels/CatalogItem.cs index c869b7382..f97adf2d5 100644 --- a/src/Web/WebMVC/ViewModels/CatalogItem.cs +++ b/src/Web/WebMVC/ViewModels/CatalogItem.cs @@ -1,6 +1,4 @@ -using System; - -namespace Microsoft.eShopOnContainers.WebMVC.ViewModels +namespace Microsoft.eShopOnContainers.WebMVC.ViewModels { public class CatalogItem { diff --git a/src/Web/WebMVC/ViewModels/CatalogViewModels/IndexViewModel.cs b/src/Web/WebMVC/ViewModels/CatalogViewModels/IndexViewModel.cs index ab14b4ee4..8f70b32d9 100644 --- a/src/Web/WebMVC/ViewModels/CatalogViewModels/IndexViewModel.cs +++ b/src/Web/WebMVC/ViewModels/CatalogViewModels/IndexViewModel.cs @@ -1,9 +1,6 @@ using Microsoft.AspNetCore.Mvc.Rendering; using Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination; -using System; using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Microsoft.eShopOnContainers.WebMVC.ViewModels.CatalogViewModels { diff --git a/src/Web/WebMVC/ViewModels/Header.cs b/src/Web/WebMVC/ViewModels/Header.cs index 212638fbc..ee97a238e 100644 --- a/src/Web/WebMVC/ViewModels/Header.cs +++ b/src/Web/WebMVC/ViewModels/Header.cs @@ -1,6 +1,4 @@ -using System; - -namespace Microsoft.eShopOnContainers.WebMVC.ViewModels +namespace Microsoft.eShopOnContainers.WebMVC.ViewModels { public class Header { 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/WebMVC/ViewModels/OrderItem.cs b/src/Web/WebMVC/ViewModels/OrderItem.cs index 3ba03b96a..a5eb4812c 100644 --- a/src/Web/WebMVC/ViewModels/OrderItem.cs +++ b/src/Web/WebMVC/ViewModels/OrderItem.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Microsoft.eShopOnContainers.WebMVC.ViewModels +namespace Microsoft.eShopOnContainers.WebMVC.ViewModels { public class OrderItem { diff --git a/src/Web/WebMVC/ViewModels/Pagination/PaginationInfo.cs b/src/Web/WebMVC/ViewModels/Pagination/PaginationInfo.cs index 0baf8e961..a10280659 100644 --- a/src/Web/WebMVC/ViewModels/Pagination/PaginationInfo.cs +++ b/src/Web/WebMVC/ViewModels/Pagination/PaginationInfo.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination +namespace Microsoft.eShopOnContainers.WebMVC.ViewModels.Pagination { public class PaginationInfo { diff --git a/src/Web/WebSPA/AppSettings.cs b/src/Web/WebSPA/AppSettings.cs index 037ed858f..c1b5bf38e 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 d8b138e47..21d29237e 100644 --- a/src/Web/WebSPA/Program.cs +++ b/src/Web/WebSPA/Program.cs @@ -1,9 +1,9 @@ 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 System.IO; namespace eShopConContainers.WebSPA { @@ -36,6 +36,6 @@ namespace eShopConContainers.WebSPA .Enrich.FromLogContext() .WriteTo.Console(); }) - .Build(); + .Build(); } } 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 2b50e7add..134b55696 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 { From c3d91dd914e4105751d20f69d42d9a5e8c05aac1 Mon Sep 17 00:00:00 2001 From: InstanceFactory Date: Wed, 23 Dec 2020 15:12:52 +0100 Subject: [PATCH 06/14] Fixed Issue #1410 (#1560) Added IdentityUrlExternal to src\Services\Ordering\Ordering.FunctionalTests\appsettings.json; sorted the properties --- .../Ordering/Ordering.FunctionalTests/appsettings.json | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Services/Ordering/Ordering.FunctionalTests/appsettings.json b/src/Services/Ordering/Ordering.FunctionalTests/appsettings.json index 07bb1638a..c59b5284e 100644 --- a/src/Services/Ordering/Ordering.FunctionalTests/appsettings.json +++ b/src/Services/Ordering/Ordering.FunctionalTests/appsettings.json @@ -1,11 +1,12 @@ { + "CheckUpdateTime": "30000", "ConnectionString": "Server=tcp:127.0.0.1,5433;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word;", + "EventBusConnection": "localhost", "ExternalCatalogBaseUrl": "http://localhost:5101", + "GracePeriodTime": "1", "IdentityUrl": "http://localhost:5105", + "IdentityUrlExternal": "http://localhost:5105", "isTest": "true", - "EventBusConnection": "localhost", - "CheckUpdateTime": "30000", - "GracePeriodTime": "1", "SubscriptionClientName": "Ordering", - "SuppressCheckForUnhandledSecurityMetadata":true + "SuppressCheckForUnhandledSecurityMetadata": true } From 81e4312cdd8e297dd07620c64b5898a30c436476 Mon Sep 17 00:00:00 2001 From: Viswanatha Swamy Date: Mon, 28 Dec 2020 15:10:01 +0530 Subject: [PATCH 07/14] Small Refactoring (#1558) --- .../Controllers/WebhooksReceivedController.cs | 7 ++----- src/Web/WebhookClient/HeaderNames.cs | 7 +------ .../HttpClientAuthorizationDelegatingHandler.cs | 2 -- src/Web/WebhookClient/Models/WebHookReceived.cs | 4 +--- src/Web/WebhookClient/Models/WebhookData.cs | 3 --- src/Web/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 +------ .../WebhookClient/Pages/RegisterWebhook.cshtml.cs | 14 +++++--------- src/Web/WebhookClient/Pages/WebhooksList.cshtml.cs | 5 +---- src/Web/WebhookClient/Program.cs | 9 +-------- src/Web/WebhookClient/Services/IHooksRepository.cs | 4 +--- src/Web/WebhookClient/Services/IWebhooksClient.cs | 4 +--- .../Services/InMemoryHooksRepository.cs | 3 +-- src/Web/WebhookClient/Services/WebhooksClient.cs | 1 - src/Web/WebhookClient/Settings.cs | 7 +------ 18 files changed, 19 insertions(+), 80 deletions(-) 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..3da5bae48 100644 --- a/src/Web/WebhookClient/Models/WebHookReceived.cs +++ b/src/Web/WebhookClient/Models/WebHookReceived.cs @@ -1,13 +1,11 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace WebhookClient.Models { public class WebHookReceived { public DateTime When { get; set; } + public string Data { get; set; } public string Token { get; set; } 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/Program.cs b/src/Web/WebhookClient/Program.cs index ff293ce5a..4d763f7fd 100644 --- a/src/Web/WebhookClient/Program.cs +++ b/src/Web/WebhookClient/Program.cs @@ -1,12 +1,5 @@ -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; namespace WebhookClient { 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/IWebhooksClient.cs b/src/Web/WebhookClient/Services/IWebhooksClient.cs index 5d14077cc..20238c0a3 100644 --- a/src/Web/WebhookClient/Services/IWebhooksClient.cs +++ b/src/Web/WebhookClient/Services/IWebhooksClient.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 { From 600d0aa456505b0b856c21c034ff4d558fc86a28 Mon Sep 17 00:00:00 2001 From: Viswanatha Swamy Date: Wed, 30 Dec 2020 11:29:47 +0530 Subject: [PATCH 08/14] Small-Formatting-Refactoring (#1564) --- .../Catalog/Catalog.API/CatalogSettings.cs | 2 +- .../Catalog.API/Controllers/CatalogController.cs | 12 ++++++------ .../Catalog/Catalog.API/Grpc/CatalogService.cs | 1 + .../Catalog.API/Infrastructure/CatalogContext.cs | 4 ++-- .../Infrastructure/CatalogContextSeed.cs | 14 +++++++------- .../CatalogIntegrationEventService.cs | 4 ++-- ...dToAwaitingValidationIntegrationEventHandler.cs | 2 +- ...erStatusChangedToPaidIntegrationEventHandler.cs | 2 +- .../Events/ProductPriceChangedIntegrationEvent.cs | 2 +- src/Services/Catalog/Catalog.API/Startup.cs | 2 +- .../ViewModel/PaginatedItemsViewModel.cs | 8 ++++---- 11 files changed, 27 insertions(+), 26 deletions(-) diff --git a/src/Services/Catalog/Catalog.API/CatalogSettings.cs b/src/Services/Catalog/Catalog.API/CatalogSettings.cs index 3bff82f3f..297c68914 100644 --- a/src/Services/Catalog/Catalog.API/CatalogSettings.cs +++ b/src/Services/Catalog/Catalog.API/CatalogSettings.cs @@ -2,7 +2,7 @@ { public class CatalogSettings { - public string PicBaseUrl { get;set;} + public string PicBaseUrl { get; set; } public string EventBusConnection { get; set; } 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/Grpc/CatalogService.cs b/src/Services/Catalog/Catalog.API/Grpc/CatalogService.cs index e502780ee..4fabfbeb4 100644 --- a/src/Services/Catalog/Catalog.API/Grpc/CatalogService.cs +++ b/src/Services/Catalog/Catalog.API/Grpc/CatalogService.cs @@ -19,6 +19,7 @@ namespace Catalog.API.Grpc private readonly CatalogContext _catalogContext; private readonly CatalogSettings _settings; private readonly ILogger _logger; + public CatalogService(CatalogContext dbContext, IOptions settings, ILogger logger) { _settings = settings.Value; diff --git a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs index cee4b5e33..ee440c1ef 100644 --- a/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs +++ b/src/Services/Catalog/Catalog.API/Infrastructure/CatalogContext.cs @@ -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/IntegrationEvents/CatalogIntegrationEventService.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs index 6c4839297..a691c06b6 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/CatalogIntegrationEventService.cs @@ -12,7 +12,7 @@ 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; @@ -73,7 +73,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 d7da9951e..95da93f75 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs @@ -11,7 +11,7 @@ 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 1a8836186..5a9b4a0f8 100644 --- a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs +++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs @@ -7,7 +7,7 @@ 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/ProductPriceChangedIntegrationEvent.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/Events/ProductPriceChangedIntegrationEvent.cs index 00f25b9e5..eda667a6e 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 class ProductPriceChangedIntegrationEvent : IntegrationEvent - { + { public int ProductId { get; private set; } public decimal NewPrice { get; private set; } diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index 2b7082e25..5747f83b4 100644 --- a/src/Services/Catalog/Catalog.API/Startup.cs +++ b/src/Services/Catalog/Catalog.API/Startup.cs @@ -81,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.API/ViewModel/PaginatedItemsViewModel.cs b/src/Services/Catalog/Catalog.API/ViewModel/PaginatedItemsViewModel.cs index 844f38e2b..d088d5bb7 100644 --- a/src/Services/Catalog/Catalog.API/ViewModel/PaginatedItemsViewModel.cs +++ b/src/Services/Catalog/Catalog.API/ViewModel/PaginatedItemsViewModel.cs @@ -15,10 +15,10 @@ public PaginatedItemsViewModel(int pageIndex, int pageSize, long count, IEnumerable data) { - this.PageIndex = pageIndex; - this.PageSize = pageSize; - this.Count = count; - this.Data = data; + PageIndex = pageIndex; + PageSize = pageSize; + Count = count; + Data = data; } } } From 6f8f247fe938e5022ab29986312df368612b0591 Mon Sep 17 00:00:00 2001 From: Viswanatha Swamy Date: Mon, 4 Jan 2021 13:32:10 +0530 Subject: [PATCH 09/14] Swamy/01jan2021-small-refactoring (#1570) * Update Startup.cs * Removed commented code * Update UrlsConfig.cs * Small Refactoring * Removed Commented Code * Small Refactoring --- .../aggregator/Models/OrderData.cs | 2 +- .../Models/UpdateBasketItemsRequest.cs | 2 +- .../aggregator/Models/UpdateBasketRequest.cs | 2 +- .../aggregator/Services/BasketService.cs | 2 +- .../aggregator/Services/CatalogService.cs | 2 +- .../aggregator/Services/GrpcCallerService.cs | 16 ---------------- .../aggregator/Config/UrlsConfig.cs | 2 +- .../aggregator/Services/GrpcCallerService.cs | 16 ---------------- .../Web.Bff.Shopping/aggregator/Startup.cs | 2 +- 9 files changed, 7 insertions(+), 39 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 8bd4c8948..b4cf4c417 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/BasketService.cs @@ -27,7 +27,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services { return await GrpcCallerService.CallService(_urls.GrpcBasket, async channel => { - + var client = new Basket.BasketClient(channel); _logger.LogDebug("grpc client created, request = {@id}", id); var response = await client.GetBasketByIdAsync(new BasketRequest { Id = id }); diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/CatalogService.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/CatalogService.cs index f98b90989..2257b408a 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/CatalogService.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/CatalogService.cs @@ -36,7 +36,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services public async Task> GetCatalogItemsAsync(IEnumerable ids) { - return await GrpcCallerService.CallService(_urls.GrpcCatalog, async channel=> + return await GrpcCallerService.CallService(_urls.GrpcCatalog, async channel => { var client = new CatalogClient(channel); var request = new CatalogItemsRequest { Ids = string.Join(",", ids), PageIndex = 1, PageSize = 10 }; diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/GrpcCallerService.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/GrpcCallerService.cs index 55f3df3ee..0160a7873 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/GrpcCallerService.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Services/GrpcCallerService.cs @@ -15,15 +15,6 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services var channel = GrpcChannel.ForAddress(urlGrpc); - /* - using var httpClientHandler = new HttpClientHandler - { - ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; } - }; - - */ - - Log.Information("Creating grpc client base address urlGrpc ={@urlGrpc}, BaseAddress={@BaseAddress} ", urlGrpc, channel.Target); try @@ -47,13 +38,6 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2Support", true); - /* - using var httpClientHandler = new HttpClientHandler - { - ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; } - }; - */ - var channel = GrpcChannel.ForAddress(urlGrpc); Log.Debug("Creating grpc client base address {@httpClient.BaseAddress} ", channel.Target); 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/GrpcCallerService.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/GrpcCallerService.cs index 2039c7c4f..83ecd95f2 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/GrpcCallerService.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Services/GrpcCallerService.cs @@ -15,15 +15,6 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services var channel = GrpcChannel.ForAddress(urlGrpc); - /* - using var httpClientHandler = new HttpClientHandler - { - ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; } - }; - - */ - - Log.Information("Creating grpc client base address urlGrpc ={@urlGrpc}, BaseAddress={@BaseAddress} ", urlGrpc, channel.Target); try @@ -49,13 +40,6 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true); AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2Support", true); - /* - using var httpClientHandler = new HttpClientHandler - { - ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; } - }; - */ - var channel = GrpcChannel.ForAddress(urlGrpc); Log.Debug("Creating grpc client base address {@httpClient.BaseAddress} ", channel.Target); diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs index 1ea6c0f4f..243e3a01e 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs @@ -63,7 +63,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator { app.UseDeveloperExceptionPage(); } - + app.UseHttpsRedirection(); app.UseSwagger().UseSwaggerUI(c => From 70a5e7bff654947e93fbb5a82a733dad47fc2e90 Mon Sep 17 00:00:00 2001 From: Sumit Ghosh Date: Tue, 12 Jan 2021 20:38:54 +0530 Subject: [PATCH 10/14] Removes dotnet.myget.org NuGetPackage feed references (#1576) * Removed Nuget package feed * Removed unused System.ValueTuple package * Downloadgraded Microsoft.AspNetCore.Hosting.Abstractions package * Removed unused package * Downgraded System.IO.Compression.ZipFile package * Used Microsoft.AspNetCore.DataProtection.StackExchangeRedis package --- .../EventBusRabbitMQ/EventBusRabbitMQ.csproj | 1 - .../WebHost.Customization.csproj | 2 +- src/NuGet.config | 15 ++++++--------- .../Catalog/Catalog.API/Catalog.API.csproj | 2 +- .../Identity/Identity.API/Identity.API.csproj | 2 +- src/Services/Identity/Identity.API/Startup.cs | 2 +- .../Ordering/Ordering.API/Ordering.API.csproj | 2 -- .../Ordering.SignalrHub.csproj | 3 +-- .../Ordering/Ordering.SignalrHub/Startup.cs | 2 +- .../Webhooks/Webhooks.API/Webhooks.API.csproj | 1 - src/Web/WebMVC/Startup.cs | 2 +- src/Web/WebMVC/WebMVC.csproj | 2 +- src/Web/WebSPA/Startup.cs | 2 +- src/Web/WebSPA/WebSPA.csproj | 2 +- 14 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj index 00b95b211..ebe29e644 100644 --- a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj +++ b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj @@ -12,7 +12,6 @@ - diff --git a/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj b/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj index a6ccbe05e..5d6816a9f 100644 --- a/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj +++ b/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj @@ -6,7 +6,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/NuGet.config b/src/NuGet.config index b9234a5b7..d6e83f199 100644 --- a/src/NuGet.config +++ b/src/NuGet.config @@ -1,12 +1,9 @@  - - - - - - - - - + + + + + + \ No newline at end of file diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj index a2c32d99b..2e08accaf 100644 --- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj +++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj @@ -65,7 +65,7 @@ - + diff --git a/src/Services/Identity/Identity.API/Identity.API.csproj b/src/Services/Identity/Identity.API/Identity.API.csproj index 426b5d461..c6bbe6185 100644 --- a/src/Services/Identity/Identity.API/Identity.API.csproj +++ b/src/Services/Identity/Identity.API/Identity.API.csproj @@ -27,7 +27,7 @@ - + diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index 0053cf3ae..46875bb54 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -60,7 +60,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API { opts.ApplicationDiscriminator = "eshop.identity"; }) - .PersistKeysToRedis(ConnectionMultiplexer.Connect(Configuration["DPConnectionString"]), "DataProtection-Keys"); + .PersistKeysToStackExchangeRedis(ConnectionMultiplexer.Connect(Configuration["DPConnectionString"]), "DataProtection-Keys"); } services.AddHealthChecks() diff --git a/src/Services/Ordering/Ordering.API/Ordering.API.csproj b/src/Services/Ordering/Ordering.API/Ordering.API.csproj index c212bfe05..2b844958b 100644 --- a/src/Services/Ordering/Ordering.API/Ordering.API.csproj +++ b/src/Services/Ordering/Ordering.API/Ordering.API.csproj @@ -67,8 +67,6 @@ - - diff --git a/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj b/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj index ebe4cb70e..b396fcc8d 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj +++ b/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj @@ -21,11 +21,10 @@ - - + diff --git a/src/Services/Ordering/Ordering.SignalrHub/Startup.cs b/src/Services/Ordering/Ordering.SignalrHub/Startup.cs index 23aaa7c78..31cbe1951 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Startup.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/Startup.cs @@ -53,7 +53,7 @@ namespace Ordering.SignalrHub { services .AddSignalR() - .AddRedis(Configuration["SignalrStoreConnectionString"]); + .AddStackExchangeRedis(Configuration["SignalrStoreConnectionString"]); } else { diff --git a/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj b/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj index 6624001c4..5d3774e7a 100644 --- a/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj +++ b/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj @@ -19,7 +19,6 @@ - diff --git a/src/Web/WebMVC/Startup.cs b/src/Web/WebMVC/Startup.cs index ccae68a09..5767e4486 100644 --- a/src/Web/WebMVC/Startup.cs +++ b/src/Web/WebMVC/Startup.cs @@ -140,7 +140,7 @@ namespace Microsoft.eShopOnContainers.WebMVC { opts.ApplicationDiscriminator = "eshop.webmvc"; }) - .PersistKeysToRedis(ConnectionMultiplexer.Connect(configuration["DPConnectionString"]), "DataProtection-Keys"); + .PersistKeysToStackExchangeRedis(ConnectionMultiplexer.Connect(configuration["DPConnectionString"]), "DataProtection-Keys"); } return services; diff --git a/src/Web/WebMVC/WebMVC.csproj b/src/Web/WebMVC/WebMVC.csproj index 16a094ab9..12d017d19 100644 --- a/src/Web/WebMVC/WebMVC.csproj +++ b/src/Web/WebMVC/WebMVC.csproj @@ -31,7 +31,7 @@ - + diff --git a/src/Web/WebSPA/Startup.cs b/src/Web/WebSPA/Startup.cs index 134b55696..58258070a 100644 --- a/src/Web/WebSPA/Startup.cs +++ b/src/Web/WebSPA/Startup.cs @@ -50,7 +50,7 @@ namespace eShopConContainers.WebSPA { opts.ApplicationDiscriminator = "eshop.webspa"; }) - .PersistKeysToRedis(ConnectionMultiplexer.Connect(Configuration["DPConnectionString"]), "DataProtection-Keys"); + .PersistKeysToStackExchangeRedis(ConnectionMultiplexer.Connect(Configuration["DPConnectionString"]), "DataProtection-Keys"); } services.AddAntiforgery(options => options.HeaderName = "X-XSRF-TOKEN"); diff --git a/src/Web/WebSPA/WebSPA.csproj b/src/Web/WebSPA/WebSPA.csproj index ff161ddc3..6c40fcfbd 100644 --- a/src/Web/WebSPA/WebSPA.csproj +++ b/src/Web/WebSPA/WebSPA.csproj @@ -92,7 +92,7 @@ - + From 1e2760c366ef9b0168cbd89427049048ac67e621 Mon Sep 17 00:00:00 2001 From: Viswanatha Swamy Date: Fri, 15 Jan 2021 14:45:24 +0530 Subject: [PATCH 11/14] Swamy/04 jan2021-small-refactoring (#1571) * Small Refactoring inside IntegrationEventLogEF * Small Refactoring inside BuildingBlocks folder --- .../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 ++-------- 17 files changed, 29 insertions(+), 67 deletions(-) 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 ef09911fe..45ffd167e 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) { From afb4534acc7af6ff94611ab98b70f1eae4b40299 Mon Sep 17 00:00:00 2001 From: Hetal Kapadia <31979831+hetal-kapadia@users.noreply.github.com> Date: Mon, 18 Jan 2021 03:13:12 -0800 Subject: [PATCH 12/14] Fixes #1581: Fixed total decimal place issue and User hover menu display/usability issue. (#1582) --- src/Web/WebMVC/Views/Order/Detail.cshtml | 2 +- src/Web/WebMVC/Views/Shared/Components/CartList/Default.cshtml | 2 +- .../WebMVC/wwwroot/css/shared/components/identity/identity.css | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Web/WebMVC/Views/Order/Detail.cshtml b/src/Web/WebMVC/Views/Order/Detail.cshtml index 6b7c0b46e..757700793 100644 --- a/src/Web/WebMVC/Views/Order/Detail.cshtml +++ b/src/Web/WebMVC/Views/Order/Detail.cshtml @@ -84,7 +84,7 @@
-
$ @Model.Total
+
$ @Model.Total.ToString("N2")
diff --git a/src/Web/WebMVC/Views/Shared/Components/CartList/Default.cshtml b/src/Web/WebMVC/Views/Shared/Components/CartList/Default.cshtml index 7531494a6..19e1bd9b1 100644 --- a/src/Web/WebMVC/Views/Shared/Components/CartList/Default.cshtml +++ b/src/Web/WebMVC/Views/Shared/Components/CartList/Default.cshtml @@ -64,7 +64,7 @@
-
$ @Model.Total()
+
$ @Model.Total().ToString("N2")
diff --git a/src/Web/WebMVC/wwwroot/css/shared/components/identity/identity.css b/src/Web/WebMVC/wwwroot/css/shared/components/identity/identity.css index cd386000c..0212a345e 100644 --- a/src/Web/WebMVC/wwwroot/css/shared/components/identity/identity.css +++ b/src/Web/WebMVC/wwwroot/css/shared/components/identity/identity.css @@ -37,6 +37,7 @@ right: 0; top: 2.5rem; transition: height 0.35s; + z-index: 1; } .esh-identity:hover .esh-identity-drop { From 130e46ccdf2554b4f957390e7f455cf3d0565c34 Mon Sep 17 00:00:00 2001 From: Viswanatha Swamy Date: Tue, 19 Jan 2021 17:36:15 +0530 Subject: [PATCH 13/14] Swamy/15jan2021 small refactoring (#1580) * Small Refactoring inside Basket Service folder * Small Refactoring --- .../Controllers/BasketController.cs | 4 +-- .../Middlewares/ByPassAuthMiddleware.cs | 2 +- .../Middlewares/FailingMiddleware.cs | 6 ++-- .../Middlewares/FailingOptions.cs | 2 +- .../Events/OrderStartedIntegrationEvent.cs | 2 +- .../ProductPriceChangedIntegrationEvent.cs | 2 +- .../Basket/Basket.API/Model/BasketItem.cs | 2 +- src/Services/Basket/Basket.API/Program.cs | 5 +-- .../Basket.API/Services/IdentityService.cs | 2 +- src/Services/Basket/Basket.API/Startup.cs | 34 +++++++++---------- .../Base/BasketTestStartup.cs | 6 ++-- .../Basket.FunctionalTests/BasketScenarios.cs | 2 +- .../RedisBasketRepositoryTests.cs | 4 +-- .../Catalog.API/Grpc/CatalogService.cs | 2 +- 14 files changed, 39 insertions(+), 36 deletions(-) diff --git a/src/Services/Basket/Basket.API/Controllers/BasketController.cs b/src/Services/Basket/Basket.API/Controllers/BasketController.cs index f51dbdb59..0a3b5879b 100644 --- a/src/Services/Basket/Basket.API/Controllers/BasketController.cs +++ b/src/Services/Basket/Basket.API/Controllers/BasketController.cs @@ -46,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)); } @@ -55,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/Infrastructure/Middlewares/ByPassAuthMiddleware.cs b/src/Services/Basket/Basket.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs index b3f42c14e..164e896e7 100644 --- a/src/Services/Basket/Basket.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs +++ b/src/Services/Basket/Basket.API/Infrastructure/Middlewares/ByPassAuthMiddleware.cs @@ -62,7 +62,7 @@ namespace Basket.API.Infrastructure.Middlewares new Claim("name", "Test user"), new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", "Test user"), new Claim("nonce", Guid.NewGuid().ToString()), - new Claim("http://schemas.microsoft.com/identity/claims/identityprovider", "ByPassAuthMiddleware"), + new Claim("http://schemas.microsoft.com/identity/claims/identityprovider", "ByPassAuthMiddleware"), new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname","User"), new Claim("sub", currentUserId), new Claim("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname","Microsoft")} diff --git a/src/Services/Basket/Basket.API/Infrastructure/Middlewares/FailingMiddleware.cs b/src/Services/Basket/Basket.API/Infrastructure/Middlewares/FailingMiddleware.cs index 108955bd4..0019a2049 100644 --- a/src/Services/Basket/Basket.API/Infrastructure/Middlewares/FailingMiddleware.cs +++ b/src/Services/Basket/Basket.API/Infrastructure/Middlewares/FailingMiddleware.cs @@ -12,6 +12,7 @@ namespace Basket.API.Infrastructure.Middlewares private bool _mustFail; private readonly FailingOptions _options; private readonly ILogger _logger; + public FailingMiddleware(RequestDelegate next, ILogger logger, FailingOptions options) { _next = next; @@ -19,6 +20,7 @@ namespace Basket.API.Infrastructure.Middlewares _mustFail = false; _logger = logger; } + public async Task Invoke(HttpContext context) { var path = context.Request.Path; @@ -44,7 +46,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 +88,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/Events/OrderStartedIntegrationEvent.cs b/src/Services/Basket/Basket.API/IntegrationEvents/Events/OrderStartedIntegrationEvent.cs index b78d10c05..c5c931d85 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; set; } 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 6f51010be..a0e3ef323 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 class ProductPriceChangedIntegrationEvent : IntegrationEvent - { + { public int ProductId { get; private set; } public decimal NewPrice { get; private set; } 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 1296256aa..1f450cc8e 100644 --- a/src/Services/Basket/Basket.API/Program.cs +++ b/src/Services/Basket/Basket.API/Program.cs @@ -61,9 +61,10 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API }) .ConfigureAppConfiguration(x => x.AddConfiguration(configuration)) - .UseFailing(options => { + .UseFailing(options => + { options.ConfigPath = "/Failing"; - options.NotFilteredPaths.AddRange(new[] {"/hc","/liveness"}); + options.NotFilteredPaths.AddRange(new[] { "/hc", "/liveness" }); }) .UseStartup() .UseContentRoot(Directory.GetCurrentDirectory()) 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 eb29c12ca..2ca54988a 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -211,7 +211,7 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API ConfigureAuth(app); app.UseStaticFiles(); - + app.UseEndpoints(endpoints => { endpoints.MapGrpcService(); @@ -253,22 +253,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/Grpc/CatalogService.cs b/src/Services/Catalog/Catalog.API/Grpc/CatalogService.cs index 4fabfbeb4..91270b576 100644 --- a/src/Services/Catalog/Catalog.API/Grpc/CatalogService.cs +++ b/src/Services/Catalog/Catalog.API/Grpc/CatalogService.cs @@ -19,7 +19,7 @@ namespace Catalog.API.Grpc private readonly CatalogContext _catalogContext; private readonly CatalogSettings _settings; private readonly ILogger _logger; - + public CatalogService(CatalogContext dbContext, IOptions settings, ILogger logger) { _settings = settings.Value; From 40faa7342f74e630b0166ee39d5c56fb5b825d7f Mon Sep 17 00:00:00 2001 From: william-keller Date: Wed, 20 Jan 2021 05:51:02 -0300 Subject: [PATCH 14/14] Incorrect ContentPage.ToolbarItems in a TabbedPage (#1348) Incorrect ContentPage.ToolbarItems in a TabbedPage --- .../eShopOnContainers.Core/Views/MainView.xaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/MainView.xaml b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/MainView.xaml index 716ab4f43..e6749132a 100644 --- a/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/MainView.xaml +++ b/src/Mobile/eShopOnContainers/eShopOnContainers.Core/Views/MainView.xaml @@ -14,7 +14,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -68,4 +68,4 @@ - \ No newline at end of file +