diff --git a/src/BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj b/src/BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj
index 415ba11bc8..9e640f87c0 100644
--- a/src/BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj
+++ b/src/BuildingBlocks/EventBus/EventBus.Tests/EventBus.Tests.csproj
@@ -1,7 +1,8 @@
-
+
net7.0
+ enable
false
false
diff --git a/src/BuildingBlocks/EventBus/EventBus.Tests/InMemory_SubscriptionManager_Tests.cs b/src/BuildingBlocks/EventBus/EventBus.Tests/InMemory_SubscriptionManager_Tests.cs
index 5309a4a9f8..9b5a30103b 100644
--- a/src/BuildingBlocks/EventBus/EventBus.Tests/InMemory_SubscriptionManager_Tests.cs
+++ b/src/BuildingBlocks/EventBus/EventBus.Tests/InMemory_SubscriptionManager_Tests.cs
@@ -1,5 +1,4 @@
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus;
-using System.Linq;
using Xunit;
namespace EventBus.Tests
diff --git a/src/BuildingBlocks/EventBus/EventBus.Tests/TestIntegrationEventHandler.cs b/src/BuildingBlocks/EventBus/EventBus.Tests/TestIntegrationEventHandler.cs
index b82ac6a5f3..177c1eab76 100644
--- a/src/BuildingBlocks/EventBus/EventBus.Tests/TestIntegrationEventHandler.cs
+++ b/src/BuildingBlocks/EventBus/EventBus.Tests/TestIntegrationEventHandler.cs
@@ -1,5 +1,4 @@
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
-using System.Threading.Tasks;
namespace EventBus.Tests
{
diff --git a/src/BuildingBlocks/EventBus/EventBus.Tests/TestIntegrationOtherEventHandler.cs b/src/BuildingBlocks/EventBus/EventBus.Tests/TestIntegrationOtherEventHandler.cs
index 82ea25baa5..3f529219be 100644
--- a/src/BuildingBlocks/EventBus/EventBus.Tests/TestIntegrationOtherEventHandler.cs
+++ b/src/BuildingBlocks/EventBus/EventBus.Tests/TestIntegrationOtherEventHandler.cs
@@ -1,5 +1,4 @@
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
-using System.Threading.Tasks;
namespace EventBus.Tests
{
diff --git a/src/Directory.Packages.props b/src/Directory.Packages.props
index 9a7ce49ecd..2eefee58b3 100644
--- a/src/Directory.Packages.props
+++ b/src/Directory.Packages.props
@@ -88,6 +88,6 @@
-
+
\ No newline at end of file
diff --git a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/OrderStartedIntegrationEventHandler.cs b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/OrderStartedIntegrationEventHandler.cs
index 8796197c07..22b1a830bd 100644
--- a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/OrderStartedIntegrationEventHandler.cs
+++ b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/OrderStartedIntegrationEventHandler.cs
@@ -15,7 +15,7 @@ public OrderStartedIntegrationEventHandler(
public async Task Handle(OrderStartedIntegrationEvent @event)
{
- using (_logger.BeginScope(new List> { new ("IntegrationEventContext", @event.Id) }))
+ using (_logger.BeginScope(new List> { new("IntegrationEventContext", @event.Id) }))
{
_logger.LogInformation("Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event);
diff --git a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs
index 94c39cd5ea..b84d16591e 100644
--- a/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs
+++ b/src/Services/Basket/Basket.API/IntegrationEvents/EventHandling/ProductPriceChangedIntegrationEventHandler.cs
@@ -15,7 +15,7 @@ public ProductPriceChangedIntegrationEventHandler(
public async Task Handle(ProductPriceChangedIntegrationEvent @event)
{
- using (_logger.BeginScope(new List> { new ("IntegrationEventContext", @event.Id) }))
+ using (_logger.BeginScope(new List> { new("IntegrationEventContext", @event.Id) }))
{
_logger.LogInformation("Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event);
diff --git a/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj b/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj
index 717520e679..9df4803122 100644
--- a/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj
+++ b/src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj
@@ -2,6 +2,7 @@
net7.0
+ enable
false
false
diff --git a/src/Services/Basket/Basket.FunctionalTests/BasketScenarios.cs b/src/Services/Basket/Basket.FunctionalTests/BasketScenarios.cs
index 4a96207a49..fa9d2036eb 100644
--- a/src/Services/Basket/Basket.FunctionalTests/BasketScenarios.cs
+++ b/src/Services/Basket/Basket.FunctionalTests/BasketScenarios.cs
@@ -1,6 +1,6 @@
namespace Basket.FunctionalTests;
-public class BasketScenarios :
+public class BasketScenarios :
BasketScenarioBase
{
[Fact]
@@ -33,7 +33,7 @@ await server.CreateClient()
var contentCheckout = new StringContent(BuildCheckout(), UTF8Encoding.UTF8, "application/json")
{
- Headers = { { "x-requestid", Guid.NewGuid().ToString() } }
+ Headers = { { "x-requestid", Guid.NewGuid().ToString() } }
};
var response = await server.CreateClient()
diff --git a/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj b/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj
index e39449ab90..cf88eb79b5 100644
--- a/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj
+++ b/src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj
@@ -2,6 +2,7 @@
net7.0
+ enable
false
false
false
diff --git a/src/Services/Basket/Basket.UnitTests/GlobalUsings.cs b/src/Services/Basket/Basket.UnitTests/GlobalUsings.cs
index 62eb6d21a7..5f73c46307 100644
--- a/src/Services/Basket/Basket.UnitTests/GlobalUsings.cs
+++ b/src/Services/Basket/Basket.UnitTests/GlobalUsings.cs
@@ -1,18 +1,18 @@
-global using Basket.API.IntegrationEvents.Events;
+global using System;
+global using System.Collections.Generic;
+global using System.Security.Claims;
+global using System.Threading.Tasks;
+global using Basket.API.IntegrationEvents.Events;
global using Basket.API.Model;
global using Microsoft.AspNetCore.Http;
global using Microsoft.AspNetCore.Mvc;
global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
global using Microsoft.eShopOnContainers.Services.Basket.API.Controllers;
+global using Microsoft.eShopOnContainers.WebMVC.Controllers;
+global using Microsoft.eShopOnContainers.WebMVC.Services;
+global using Microsoft.eShopOnContainers.WebMVC.ViewModels;
global using Microsoft.Extensions.Logging;
global using Moq;
-global using System;
-global using System.Collections.Generic;
-global using System.Security.Claims;
-global using System.Threading.Tasks;
global using Xunit;
global using IBasketIdentityService = Microsoft.eShopOnContainers.Services.Basket.API.Services.IIdentityService;
-global using Microsoft.eShopOnContainers.WebMVC.Controllers;
-global using Microsoft.eShopOnContainers.WebMVC.Services;
-global using Microsoft.eShopOnContainers.WebMVC.ViewModels;
global using BasketModel = Microsoft.eShopOnContainers.WebMVC.ViewModels.Basket;
diff --git a/src/Services/Catalog/Catalog.API/Apis/PicApi.cs b/src/Services/Catalog/Catalog.API/Apis/PicApi.cs
index 277b718a7b..70442d5309 100644
--- a/src/Services/Catalog/Catalog.API/Apis/PicApi.cs
+++ b/src/Services/Catalog/Catalog.API/Apis/PicApi.cs
@@ -1,6 +1,4 @@
-using Microsoft.AspNetCore.Routing;
-
-namespace Catalog.API.Apis;
+namespace Catalog.API.Apis;
public static class PicApi
{
diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs
index 6ad0a3867d..453e975e69 100644
--- a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs
+++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToAwaitingValidationIntegrationEventHandler.cs
@@ -14,12 +14,12 @@ public OrderStatusChangedToAwaitingValidationIntegrationEventHandler(
{
_catalogContext = catalogContext;
_catalogIntegrationEventService = catalogIntegrationEventService;
- _logger = logger ?? throw new System.ArgumentNullException(nameof(logger));
+ _logger = logger ?? throw new ArgumentNullException(nameof(logger));
}
public async Task Handle(OrderStatusChangedToAwaitingValidationIntegrationEvent @event)
{
- using (_logger.BeginScope(new List> { new ("IntegrationEventContext", @event.Id) }))
+ using (_logger.BeginScope(new List> { new("IntegrationEventContext", @event.Id) }))
{
_logger.LogInformation("Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event);
diff --git a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs
index 48e7fe571b..7d3519b90e 100644
--- a/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs
+++ b/src/Services/Catalog/Catalog.API/IntegrationEvents/EventHandling/OrderStatusChangedToPaidIntegrationEventHandler.cs
@@ -11,12 +11,12 @@ public OrderStatusChangedToPaidIntegrationEventHandler(
ILogger logger)
{
_catalogContext = catalogContext;
- _logger = logger ?? throw new System.ArgumentNullException(nameof(logger));
+ _logger = logger ?? throw new ArgumentNullException(nameof(logger));
}
public async Task Handle(OrderStatusChangedToPaidIntegrationEvent @event)
{
- using (_logger.BeginScope(new List> { new ("IntegrationEventContext", @event.Id) }))
+ using (_logger.BeginScope(new List> { new("IntegrationEventContext", @event.Id) }))
{
_logger.LogInformation("Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event);
diff --git a/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj b/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj
index 37f9cf89bb..ac5bd1a76d 100644
--- a/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj
+++ b/src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj
@@ -2,6 +2,7 @@
net7.0
+ enable
false
false
diff --git a/src/Services/Catalog/Catalog.FunctionalTests/CatalogScenarioBase.cs b/src/Services/Catalog/Catalog.FunctionalTests/CatalogScenarioBase.cs
index 64296dd0a3..d49cad5f76 100644
--- a/src/Services/Catalog/Catalog.FunctionalTests/CatalogScenarioBase.cs
+++ b/src/Services/Catalog/Catalog.FunctionalTests/CatalogScenarioBase.cs
@@ -1,9 +1,8 @@
-using System;
-using Microsoft.AspNetCore.Mvc.Testing;
+using Microsoft.AspNetCore.Mvc.Testing;
namespace Catalog.FunctionalTests;
-public class CatalogScenariosBase
+public class CatalogScenariosBase
{
private class CatalogApplication : WebApplicationFactory
{
diff --git a/src/Services/Catalog/Catalog.FunctionalTests/GlobalUsings.cs b/src/Services/Catalog/Catalog.FunctionalTests/GlobalUsings.cs
index 2ceffc5354..58dbf6ade1 100644
--- a/src/Services/Catalog/Catalog.FunctionalTests/GlobalUsings.cs
+++ b/src/Services/Catalog/Catalog.FunctionalTests/GlobalUsings.cs
@@ -1,16 +1,8 @@
-global using Microsoft.AspNetCore.Hosting;
+global using System.IO;
+global using System.Net;
+global using System.Threading.Tasks;
+global using Microsoft.AspNetCore.Hosting;
global using Microsoft.AspNetCore.TestHost;
-global using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF;
-global using Microsoft.eShopOnContainers.Services.Catalog.API.Extensions;
-global using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure;
-global using Microsoft.eShopOnContainers.Services.Catalog.API;
global using Microsoft.Extensions.Configuration;
-global using Microsoft.Extensions.DependencyInjection;
global using Microsoft.Extensions.Hosting;
-global using Microsoft.Extensions.Logging;
-global using Microsoft.Extensions.Options;
-global using System.IO;
-global using System.Net;
-global using System.Reflection;
-global using System.Threading.Tasks;
global using Xunit;
diff --git a/src/Services/Catalog/Catalog.UnitTests/Application/CatalogControllerTest.cs b/src/Services/Catalog/Catalog.UnitTests/Application/CatalogControllerTest.cs
index 53efafbfde..1ea092cbb2 100644
--- a/src/Services/Catalog/Catalog.UnitTests/Application/CatalogControllerTest.cs
+++ b/src/Services/Catalog/Catalog.UnitTests/Application/CatalogControllerTest.cs
@@ -1,16 +1,13 @@
-using Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents;
-using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.eShopOnContainers.Services.Catalog.API;
using Microsoft.eShopOnContainers.Services.Catalog.API.Controllers;
using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure;
+using Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents;
using Microsoft.eShopOnContainers.Services.Catalog.API.Model;
using Microsoft.eShopOnContainers.Services.Catalog.API.ViewModel;
using Microsoft.Extensions.Options;
using Moq;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
using Xunit;
namespace UnitTest.Catalog.Application;
diff --git a/src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj b/src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj
index a0fbbf2f18..9b49e8fb86 100644
--- a/src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj
+++ b/src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj
@@ -2,6 +2,7 @@
net7.0
+ enable
false
false
false
diff --git a/src/Services/Identity/Identity.API/SeedData.cs b/src/Services/Identity/Identity.API/SeedData.cs
index fa8365f9e8..ad2c37bf35 100644
--- a/src/Services/Identity/Identity.API/SeedData.cs
+++ b/src/Services/Identity/Identity.API/SeedData.cs
@@ -92,7 +92,7 @@ await retryPolicy.ExecuteAsync(async () =>
});
}
- private static AsyncPolicy CreateRetryPolicy(IConfiguration configuration, Microsoft.Extensions.Logging.ILogger logger)
+ private static AsyncPolicy CreateRetryPolicy(IConfiguration configuration, ILogger logger)
{
var retryMigrations = false;
bool.TryParse(configuration["RetryMigrations"], out retryMigrations);
diff --git a/src/Services/Ordering/Ordering.API/Application/Behaviors/TransactionBehavior.cs b/src/Services/Ordering/Ordering.API/Application/Behaviors/TransactionBehavior.cs
index acebd9cda7..a4ddcc2038 100644
--- a/src/Services/Ordering/Ordering.API/Application/Behaviors/TransactionBehavior.cs
+++ b/src/Services/Ordering/Ordering.API/Application/Behaviors/TransactionBehavior.cs
@@ -36,7 +36,7 @@ await strategy.ExecuteAsync(async () =>
Guid transactionId;
await using var transaction = await _dbContext.BeginTransactionAsync();
- using (_logger.BeginScope(new List> { new ("TransactionContext", transaction.TransactionId) }))
+ using (_logger.BeginScope(new List> { new("TransactionContext", transaction.TransactionId) }))
{
_logger.LogInformation("Begin transaction {TransactionId} for {CommandName} ({@Command})", transaction.TransactionId, typeName, request);
diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/GracePeriodConfirmedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/GracePeriodConfirmedIntegrationEventHandler.cs
index fdab024585..3639df4362 100644
--- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/GracePeriodConfirmedIntegrationEventHandler.cs
+++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/GracePeriodConfirmedIntegrationEventHandler.cs
@@ -10,7 +10,7 @@ public GracePeriodConfirmedIntegrationEventHandler(
ILogger logger)
{
_mediator = mediator;
- _logger = logger ?? throw new System.ArgumentNullException(nameof(logger));
+ _logger = logger ?? throw new ArgumentNullException(nameof(logger));
}
///
@@ -23,7 +23,7 @@ public GracePeriodConfirmedIntegrationEventHandler(
///
public async Task Handle(GracePeriodConfirmedIntegrationEvent @event)
{
- using (_logger.BeginScope(new List> { new ("IntegrationEventContext", @event.Id) }))
+ using (_logger.BeginScope(new List> { new("IntegrationEventContext", @event.Id) }))
{
_logger.LogInformation("Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event);
diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentFailedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentFailedIntegrationEventHandler.cs
index 6982a5a250..2596c759bf 100644
--- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentFailedIntegrationEventHandler.cs
+++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentFailedIntegrationEventHandler.cs
@@ -16,7 +16,7 @@ public OrderPaymentFailedIntegrationEventHandler(
public async Task Handle(OrderPaymentFailedIntegrationEvent @event)
{
- using (_logger.BeginScope(new List> { new ("IntegrationEventContext", @event.Id) }))
+ using (_logger.BeginScope(new List> { new("IntegrationEventContext", @event.Id) }))
{
_logger.LogInformation("Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event);
diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentSucceededIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentSucceededIntegrationEventHandler.cs
index 31606ead2e..bbe7186b50 100644
--- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentSucceededIntegrationEventHandler.cs
+++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderPaymentSucceededIntegrationEventHandler.cs
@@ -16,7 +16,7 @@ public OrderPaymentSucceededIntegrationEventHandler(
public async Task Handle(OrderPaymentSucceededIntegrationEvent @event)
{
- using (_logger.BeginScope(new List> { new ("IntegrationEventContext", @event.Id) }))
+ using (_logger.BeginScope(new List> { new("IntegrationEventContext", @event.Id) }))
{
_logger.LogInformation("Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event);
diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs
index a9faea4658..2b35ef3c49 100644
--- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs
+++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockConfirmedIntegrationEventHandler.cs
@@ -16,7 +16,7 @@ public OrderStockConfirmedIntegrationEventHandler(
public async Task Handle(OrderStockConfirmedIntegrationEvent @event)
{
- using (_logger.BeginScope(new List> { new ("IntegrationEventContext", @event.Id) }))
+ using (_logger.BeginScope(new List> { new("IntegrationEventContext", @event.Id) }))
{
_logger.LogInformation("Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event);
diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs
index 0d47e7a84c..a6bafa568f 100644
--- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs
+++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/OrderStockRejectedIntegrationEventHandler.cs
@@ -9,12 +9,12 @@ public OrderStockRejectedIntegrationEventHandler(
ILogger logger)
{
_mediator = mediator;
- _logger = logger ?? throw new System.ArgumentNullException(nameof(logger));
+ _logger = logger ?? throw new ArgumentNullException(nameof(logger));
}
public async Task Handle(OrderStockRejectedIntegrationEvent @event)
{
- using (_logger.BeginScope(new List> { new ("IntegrationEventContext", @event.Id) }))
+ using (_logger.BeginScope(new List> { new("IntegrationEventContext", @event.Id) }))
{
_logger.LogInformation("Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event);
diff --git a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs
index 731bc986f8..e2d5584d80 100644
--- a/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs
+++ b/src/Services/Ordering/Ordering.API/Application/IntegrationEvents/EventHandling/UserCheckoutAcceptedIntegrationEventHandler.cs
@@ -24,7 +24,7 @@ public UserCheckoutAcceptedIntegrationEventHandler(
///
public async Task Handle(UserCheckoutAcceptedIntegrationEvent @event)
{
- using (_logger.BeginScope(new List> { new ("IntegrationEventContext", @event.Id) }))
+ using (_logger.BeginScope(new List> { new("IntegrationEventContext", @event.Id) }))
{
_logger.LogInformation("Handling integration event: {IntegrationEventId} - ({@IntegrationEvent})", @event.Id, @event);
@@ -32,7 +32,7 @@ public async Task Handle(UserCheckoutAcceptedIntegrationEvent @event)
if (@event.RequestId != Guid.Empty)
{
- using (_logger.BeginScope(new List> { new ("IdentifiedCommandId", @event.RequestId) }))
+ using (_logger.BeginScope(new List> { new("IdentifiedCommandId", @event.RequestId) }))
{
var createOrderCommand = new CreateOrderCommand(@event.Basket.Items, @event.UserId, @event.UserName, @event.City, @event.Street,
@event.State, @event.Country, @event.ZipCode,
diff --git a/src/Services/Ordering/Ordering.API/Application/Validations/CreateOrderCommandValidator.cs b/src/Services/Ordering/Ordering.API/Application/Validations/CreateOrderCommandValidator.cs
index 51953b25dd..0e7db99ec3 100644
--- a/src/Services/Ordering/Ordering.API/Application/Validations/CreateOrderCommandValidator.cs
+++ b/src/Services/Ordering/Ordering.API/Application/Validations/CreateOrderCommandValidator.cs
@@ -1,7 +1,4 @@
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Validations;
-
-using static Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands.CreateOrderCommand;
-
public class CreateOrderCommandValidator : AbstractValidator
{
public CreateOrderCommandValidator(ILogger logger)
diff --git a/src/Services/Ordering/Ordering.API/Grpc/OrderingService.cs b/src/Services/Ordering/Ordering.API/Grpc/OrderingService.cs
index 23525d5bff..1a2d17537e 100644
--- a/src/Services/Ordering/Ordering.API/Grpc/OrderingService.cs
+++ b/src/Services/Ordering/Ordering.API/Grpc/OrderingService.cs
@@ -1,8 +1,7 @@
using GrpcOrdering;
-
-using OrderDraftDTO = GrpcOrdering.OrderDraftDTO;
-using CreateOrderDraftCommand = GrpcOrdering.CreateOrderDraftCommand;
using BasketItem = GrpcOrdering.BasketItem;
+using CreateOrderDraftCommand = GrpcOrdering.CreateOrderDraftCommand;
+using OrderDraftDTO = GrpcOrdering.OrderDraftDTO;
using OrderItemDTO = GrpcOrdering.OrderItemDTO;
public class OrderingService : OrderingGrpc.OrderingGrpcBase
diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj b/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj
index eefdf03f43..41ce41ed12 100644
--- a/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj
+++ b/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj
@@ -4,7 +4,7 @@
net7.0
enable
dotnet-Ordering.BackgroundTasks-9D3E1DD6-405B-447F-8AAB-1708B36D260E
- Linux
+ Linux
diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Services/GracePeriodManagerService.cs b/src/Services/Ordering/Ordering.BackgroundTasks/Services/GracePeriodManagerService.cs
index 5f6409546c..016f0eb9cc 100644
--- a/src/Services/Ordering/Ordering.BackgroundTasks/Services/GracePeriodManagerService.cs
+++ b/src/Services/Ordering/Ordering.BackgroundTasks/Services/GracePeriodManagerService.cs
@@ -1,7 +1,4 @@
-using System.Collections.Generic;
-using System.Data.SqlClient;
-using System.Threading;
-using System.Threading.Tasks;
+using System.Data.SqlClient;
using Dapper;
using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions;
using Microsoft.Extensions.Options;
diff --git a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs
index 8e452c42f5..8926524ef2 100644
--- a/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs
+++ b/src/Services/Ordering/Ordering.Domain/AggregatesModel/OrderAggregate/Order.cs
@@ -19,15 +19,15 @@ public class Order
private string _description;
-
-
// Draft orders have this set to true. Currently we don't check anywhere the draft status of an Order, but we could do it if needed
+#pragma warning disable CS0414 // The field 'Order._isDraft' is assigned but its value is never used
private bool _isDraft;
+#pragma warning restore CS0414
// DDD Patterns comment
// Using a private collection field, better for DDD Aggregate's encapsulation
// so OrderItems cannot be added from "outside the AggregateRoot" directly to the collection,
- // but only through the method OrderAggrergateRoot.AddOrderItem() which includes behaviour.
+ // but only through the method OrderAggregateRoot.AddOrderItem() which includes behavior.
private readonly List _orderItems;
public IReadOnlyCollection OrderItems => _orderItems;
@@ -35,8 +35,10 @@ public class Order
public static Order NewDraft()
{
- var order = new Order();
- order._isDraft = true;
+ var order = new Order
+ {
+ _isDraft = true
+ };
return order;
}
@@ -56,13 +58,13 @@ public Order(string userId, string userName, Address address, int cardTypeId, st
Address = address;
// Add the OrderStarterDomainEvent to the domain events collection
- // to be raised/dispatched when comitting changes into the Database [ After DbContext.SaveChanges() ]
+ // to be raised/dispatched when committing changes into the Database [ After DbContext.SaveChanges() ]
AddOrderStartedDomainEvent(userId, userName, cardTypeId, cardNumber,
cardSecurityNumber, cardHolderName, cardExpiration);
}
// DDD Patterns comment
- // This Order AggregateRoot's method "AddOrderitem()" should be the only way to add Items to the Order,
+ // This Order AggregateRoot's method "AddOrderItem()" should be the only way to add Items to the Order,
// so any behavior (discounts, etc.) and validations are controlled by the AggregateRoot
// in order to maintain consistency between the whole Aggregate.
public void AddOrderItem(int productId, string productName, decimal unitPrice, decimal discount, string pictureUrl, int units = 1)
diff --git a/src/Services/Ordering/Ordering.Domain/GlobalUsings.cs b/src/Services/Ordering/Ordering.Domain/GlobalUsings.cs
index 866be7bcb0..a7b4f4d403 100644
--- a/src/Services/Ordering/Ordering.Domain/GlobalUsings.cs
+++ b/src/Services/Ordering/Ordering.Domain/GlobalUsings.cs
@@ -1,5 +1,5 @@
global using System.Reflection;
-global using global::Microsoft.eShopOnContainers.Services.Ordering.Domain.Exceptions;
+global using Microsoft.eShopOnContainers.Services.Ordering.Domain.Exceptions;
global using MediatR;
global using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
global using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
diff --git a/src/Services/Ordering/Ordering.FunctionalTests/GlobalUsings.cs b/src/Services/Ordering/Ordering.FunctionalTests/GlobalUsings.cs
index cee4b67336..5c3815a9f7 100644
--- a/src/Services/Ordering/Ordering.FunctionalTests/GlobalUsings.cs
+++ b/src/Services/Ordering/Ordering.FunctionalTests/GlobalUsings.cs
@@ -1,19 +1,9 @@
-global using Microsoft.AspNetCore.Builder;
+global using System.IO;
+global using System.Net.Http;
+global using System.Security.Claims;
+global using Microsoft.AspNetCore.Builder;
global using Microsoft.AspNetCore.Hosting;
global using Microsoft.AspNetCore.Http;
-global using Microsoft.AspNetCore.Routing;
global using Microsoft.AspNetCore.TestHost;
-global using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF;
-global using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure;
-global using Microsoft.eShopOnContainers.Services.Ordering.API;
-global using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure;
global using Microsoft.Extensions.Configuration;
global using Microsoft.Extensions.DependencyInjection;
-global using Microsoft.Extensions.Logging;
-global using Microsoft.Extensions.Options;
-global using System.IO;
-global using System.Net.Http;
-global using System.Reflection;
-global using System.Security.Claims;
-global using System.Threading.Tasks;
-global using System;
diff --git a/src/Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj b/src/Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj
index 9d998af72d..29fe059ac2 100644
--- a/src/Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj
+++ b/src/Services/Ordering/Ordering.FunctionalTests/Ordering.FunctionalTests.csproj
@@ -2,6 +2,7 @@
net7.0
+ enable
false
false
diff --git a/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs b/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs
index 66af0bbd59..b7ff89a681 100644
--- a/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs
+++ b/src/Services/Ordering/Ordering.Infrastructure/OrderingContext.cs
@@ -50,7 +50,7 @@ public async Task SaveEntitiesAsync(CancellationToken cancellationToken =
// After executing this line all the changes (from the Command Handler and Domain Event Handlers)
// performed through the DbContext will be committed
- var result = await base.SaveChangesAsync(cancellationToken);
+ _ = await base.SaveChangesAsync(cancellationToken);
return true;
}
@@ -106,6 +106,8 @@ public void RollbackTransaction()
}
}
+#nullable enable
+
public class OrderingContextDesignFactory : IDesignTimeDbContextFactory
{
public OrderingContext CreateDbContext(string[] args)
@@ -120,12 +122,12 @@ class NoMediator : IMediator
{
public IAsyncEnumerable CreateStream(IStreamRequest request, CancellationToken cancellationToken = default)
{
- return default;
+ return default!;
}
public IAsyncEnumerable