diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/GlobalUsings.cs b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/GlobalUsings.cs index 65efabf33..23bb7c6eb 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/GlobalUsings.cs +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/GlobalUsings.cs @@ -1,24 +1,13 @@ -global using CatalogApi; -global using Grpc.Core.Interceptors; +global using System.Text.Json; +global using CatalogApi; global using Grpc.Core; +global using Grpc.Core.Interceptors; global using GrpcBasket; global using Microsoft.AspNetCore.Authorization; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.AspNetCore.Http; global using Microsoft.AspNetCore.Mvc; global using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Config; global using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Infrastructure; global using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models; global using Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; global using Microsoft.Extensions.Options; -global using System.Collections.Generic; -global using System.Linq; -global using System.Net.Http; -global using System.Net; -global using System.Text.Json; -global using System.Threading.Tasks; -global using System; global using Services.Common; diff --git a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj index 35f37cb53..7a4b8ed2d 100644 --- a/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj +++ b/src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj @@ -5,31 +5,15 @@ Mobile.Shopping.HttpAggregator Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator ..\..\..\docker-compose.dcproj - false - true + enable - - - - - - - - - - - - - - - diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/GlobalUsings.cs b/src/ApiGateways/Web.Bff.Shopping/aggregator/GlobalUsings.cs index 97b9e1222..0b09dde36 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/GlobalUsings.cs +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/GlobalUsings.cs @@ -1,27 +1,13 @@ -global using System; -global using System.Collections.Generic; -global using System.Linq; -global using System.Net; -global using System.Net.Http; -global using System.Net.Http.Headers; -global using System.Text.Json; -global using System.Threading; -global using System.Threading.Tasks; +global using System.Text.Json; global using CatalogApi; global using Grpc.Core; global using Grpc.Core.Interceptors; global using GrpcBasket; -global using Microsoft.AspNetCore.Authentication; global using Microsoft.AspNetCore.Authorization; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.AspNetCore.Http; global using Microsoft.AspNetCore.Mvc; global using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config; global using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Infrastructure; global using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; global using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; global using Microsoft.Extensions.Options; global using Services.Common; diff --git a/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj b/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj index d7523af19..7417597af 100644 --- a/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj +++ b/src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj @@ -4,6 +4,7 @@ net7.0 Web.Shopping.HttpAggregator Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator + enable ..\..\..\docker-compose.dcproj diff --git a/src/BuildingBlocks/EventBus/EventBus/EventBus.csproj b/src/BuildingBlocks/EventBus/EventBus/EventBus.csproj index 6d33cff34..f2f64f36b 100644 --- a/src/BuildingBlocks/EventBus/EventBus/EventBus.csproj +++ b/src/BuildingBlocks/EventBus/EventBus/EventBus.csproj @@ -2,6 +2,7 @@ net7.0 + enable Microsoft.eShopOnContainers.BuildingBlocks.EventBus diff --git a/src/BuildingBlocks/EventBus/EventBus/GlobalUsings.cs b/src/BuildingBlocks/EventBus/EventBus/GlobalUsings.cs index faddc5a13..607805e33 100644 --- a/src/BuildingBlocks/EventBus/EventBus/GlobalUsings.cs +++ b/src/BuildingBlocks/EventBus/EventBus/GlobalUsings.cs @@ -1,8 +1,4 @@ -global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; +global using System.Text.Json.Serialization; +global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; global using static Microsoft.eShopOnContainers.BuildingBlocks.EventBus.InMemoryEventBusSubscriptionsManager; -global using System.Collections.Generic; -global using System.Linq; -global using System.Text.Json.Serialization; -global using System.Threading.Tasks; -global using System; diff --git a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj index 329cc99e1..d0c268e50 100644 --- a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj +++ b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj @@ -2,6 +2,7 @@ net7.0 + enable Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ diff --git a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/GlobalUsings.cs b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/GlobalUsings.cs index d63437f0e..9e0f24567 100644 --- a/src/BuildingBlocks/EventBus/EventBusRabbitMQ/GlobalUsings.cs +++ b/src/BuildingBlocks/EventBus/EventBusRabbitMQ/GlobalUsings.cs @@ -1,16 +1,13 @@ -global using Microsoft.Extensions.Logging; +global using System.Net.Sockets; +global using System.Text; +global using System.Text.Json; +global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; +global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; +global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; +global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; +global using Microsoft.Extensions.Logging; global using Polly; global using Polly.Retry; global using RabbitMQ.Client; global using RabbitMQ.Client.Events; global using RabbitMQ.Client.Exceptions; -global using System; -global using System.IO; -global using System.Net.Sockets; -global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; -global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; -global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Extensions; -global using System.Text; -global using System.Threading.Tasks; -global using System.Text.Json; diff --git a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj index 8b1785e6f..b4c205741 100644 --- a/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj +++ b/src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj @@ -2,6 +2,7 @@ net7.0 + enable Microsoft.eShopOnContainers.BuildingBlocks.EventBusServiceBus diff --git a/src/BuildingBlocks/EventBus/EventBusServiceBus/GlobalUsings.cs b/src/BuildingBlocks/EventBus/EventBusServiceBus/GlobalUsings.cs index 836f5ae52..7d908e21d 100644 --- a/src/BuildingBlocks/EventBus/EventBusServiceBus/GlobalUsings.cs +++ b/src/BuildingBlocks/EventBus/EventBusServiceBus/GlobalUsings.cs @@ -1,13 +1,11 @@ -global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; -global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -global using System.Threading.Tasks; -global using System; -global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; -global using Microsoft.Extensions.Logging; -global using System.Text; +global using System.Text; global using System.Text.Json; global using Azure.Messaging.ServiceBus; global using Azure.Messaging.ServiceBus.Administration; +global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus; +global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; +global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; +global using Microsoft.Extensions.Logging; diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/GlobalUsings.cs b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/GlobalUsings.cs index 866b0cea6..6f43fe2fe 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/GlobalUsings.cs +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/GlobalUsings.cs @@ -1,12 +1,8 @@ -global using Microsoft.EntityFrameworkCore; -global using Microsoft.EntityFrameworkCore.Metadata.Builders; -global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; -global using System; -global using System.Text.Json; -global using System.ComponentModel.DataAnnotations.Schema; -global using System.Linq; -global using System.Threading.Tasks; -global using Microsoft.EntityFrameworkCore.Storage; -global using System.Collections.Generic; +global using System.ComponentModel.DataAnnotations.Schema; global using System.Data.Common; global using System.Reflection; +global using System.Text.Json; +global using Microsoft.EntityFrameworkCore; +global using Microsoft.EntityFrameworkCore.Metadata.Builders; +global using Microsoft.EntityFrameworkCore.Storage; +global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; diff --git a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj index 356a583fb..8879349cb 100644 --- a/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj +++ b/src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj @@ -2,6 +2,7 @@ net7.0 + enable Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF diff --git a/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj b/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj index 4b1055ace..ed969814c 100644 --- a/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj +++ b/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj @@ -2,23 +2,15 @@ net7.0 - false + enable - - - + + + - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - + - - - diff --git a/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHostExtensions.cs b/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHostExtensions.cs index 45bedc2c4..240c40569 100644 --- a/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHostExtensions.cs +++ b/src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHostExtensions.cs @@ -1,77 +1,75 @@ -using System; -using System.Data.SqlClient; +using System.Data.SqlClient; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Polly; -namespace Microsoft.AspNetCore.Hosting +namespace Microsoft.AspNetCore.Hosting; + +public static class IWebHostExtensions { - public static class IWebHostExtensions + public static bool IsInKubernetes(this IServiceProvider services) { - public static bool IsInKubernetes(this IServiceProvider services) - { - var cfg = services.GetService(); - var orchestratorType = cfg.GetValue("OrchestratorType"); - return orchestratorType?.ToUpper() == "K8S"; - } - - public static IServiceProvider MigrateDbContext(this IServiceProvider services, Action seeder) where TContext : DbContext - { - var underK8s = services.IsInKubernetes(); - - using var scope = services.CreateScope(); - var scopeServices = scope.ServiceProvider; - var logger = scopeServices.GetRequiredService>(); - var context = scopeServices.GetService(); + var cfg = services.GetService(); + var orchestratorType = cfg.GetValue("OrchestratorType"); + return orchestratorType?.ToUpper() == "K8S"; + } - try - { - logger.LogInformation("Migrating database associated with context {DbContextName}", typeof(TContext).Name); + public static IServiceProvider MigrateDbContext(this IServiceProvider services, Action seeder) where TContext : DbContext + { + var underK8s = services.IsInKubernetes(); - if (underK8s) - { - InvokeSeeder(seeder, context, scopeServices); - } - else - { - var retries = 10; - var retry = Policy.Handle() - .WaitAndRetry( - retryCount: retries, - sleepDurationProvider: retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)), - onRetry: (exception, timeSpan, retry, ctx) => - { - logger.LogWarning(exception, "[{prefix}] Error migrating database (attempt {retry} of {retries})", nameof(TContext), retry, retries); - }); + using var scope = services.CreateScope(); + var scopeServices = scope.ServiceProvider; + var logger = scopeServices.GetRequiredService>(); + var context = scopeServices.GetService(); - //if the sql server container is not created on run docker compose this - //migration can't fail for network related exception. The retry options for DbContext only - //apply to transient exceptions - // Note that this is NOT applied when running some orchestrators (let the orchestrator to recreate the failing service) - retry.Execute(() => InvokeSeeder(seeder, context, scopeServices)); - } + try + { + logger.LogInformation("Migrating database associated with context {DbContextName}", typeof(TContext).Name); - logger.LogInformation("Migrated database associated with context {DbContextName}", typeof(TContext).Name); + if (underK8s) + { + InvokeSeeder(seeder, context, scopeServices); } - catch (Exception ex) + else { - logger.LogError(ex, "An error occurred while migrating the database used on context {DbContextName}", typeof(TContext).Name); - if (underK8s) - { - throw; // Rethrow under k8s because we rely on k8s to re-run the pod - } + var retries = 10; + var retry = Policy.Handle() + .WaitAndRetry( + retryCount: retries, + sleepDurationProvider: retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)), + onRetry: (exception, timeSpan, retry, ctx) => + { + logger.LogWarning(exception, "[{prefix}] Error migrating database (attempt {retry} of {retries})", nameof(TContext), retry, retries); + }); + + //if the sql server container is not created on run docker compose this + //migration can't fail for network related exception. The retry options for DbContext only + //apply to transient exceptions + // Note that this is NOT applied when running some orchestrators (let the orchestrator to recreate the failing service) + retry.Execute(() => InvokeSeeder(seeder, context, scopeServices)); } - return services; + logger.LogInformation("Migrated database associated with context {DbContextName}", typeof(TContext).Name); } - - private static void InvokeSeeder(Action seeder, TContext context, IServiceProvider services) - where TContext : DbContext + catch (Exception ex) { - context.Database.Migrate(); - seeder(context, services); + logger.LogError(ex, "An error occurred while migrating the database used on context {DbContextName}", typeof(TContext).Name); + if (underK8s) + { + throw; // Rethrow under k8s because we rely on k8s to re-run the pod + } } + + return services; + } + + private static void InvokeSeeder(Action seeder, TContext context, IServiceProvider services) + where TContext : DbContext + { + context.Database.Migrate(); + seeder(context, services); } } diff --git a/src/Services/Basket/Basket.API/Basket.API.csproj b/src/Services/Basket/Basket.API/Basket.API.csproj index 173169da1..6e58267e6 100644 --- a/src/Services/Basket/Basket.API/Basket.API.csproj +++ b/src/Services/Basket/Basket.API/Basket.API.csproj @@ -1,6 +1,7 @@  net7.0 + enable ..\..\..\..\docker-compose.dcproj 2964ec8e-0d48-4541-b305-94cab537f867 diff --git a/src/Services/Basket/Basket.API/GlobalUsings.cs b/src/Services/Basket/Basket.API/GlobalUsings.cs index e66f8b36f..73171c992 100644 --- a/src/Services/Basket/Basket.API/GlobalUsings.cs +++ b/src/Services/Basket/Basket.API/GlobalUsings.cs @@ -1,10 +1,6 @@ -global using System; -global using System.Collections.Generic; -global using System.ComponentModel.DataAnnotations; -global using System.Linq; +global using System.ComponentModel.DataAnnotations; global using System.Security.Claims; global using System.Text.Json; -global using System.Threading.Tasks; global using Basket.API.IntegrationEvents.EventHandling; global using Basket.API.IntegrationEvents.Events; global using Basket.API.Model; @@ -12,8 +8,6 @@ global using Basket.API.Repositories; global using Grpc.Core; global using GrpcBasket; global using Microsoft.AspNetCore.Authorization; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.AspNetCore.Http; global using Microsoft.AspNetCore.Mvc; global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; @@ -21,8 +15,5 @@ global using Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.E global using Microsoft.eShopOnContainers.Services.Basket.API.IntegrationEvents.Events; global using Microsoft.eShopOnContainers.Services.Basket.API.Model; global using Microsoft.eShopOnContainers.Services.Basket.API.Services; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; global using Services.Common; global using StackExchange.Redis; diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj index 8a4669c16..d047f97bb 100644 --- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj +++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj @@ -5,6 +5,7 @@ Catalog.API Catalog.API aspnet-Catalog.API-20161122013618 + enable ..\..\..\..\docker-compose.dcproj diff --git a/src/Services/Catalog/Catalog.API/GlobalUsings.cs b/src/Services/Catalog/Catalog.API/GlobalUsings.cs index 43ebd0392..3e27424b1 100644 --- a/src/Services/Catalog/Catalog.API/GlobalUsings.cs +++ b/src/Services/Catalog/Catalog.API/GlobalUsings.cs @@ -1,17 +1,10 @@ -global using System; -global using System.Collections.Generic; -global using System.Data.Common; +global using System.Data.Common; global using System.Data.SqlClient; global using System.Globalization; -global using System.IO; global using System.IO.Compression; -global using System.Linq; global using System.Text.RegularExpressions; -global using System.Threading.Tasks; +global using Catalog.API.Apis; global using Grpc.Core; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.AspNetCore.Hosting; -global using Microsoft.AspNetCore.Http; global using Microsoft.AspNetCore.Mvc; global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore.Design; @@ -32,11 +25,7 @@ global using Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents. global using Microsoft.eShopOnContainers.Services.Catalog.API.IntegrationEvents.Events; global using Microsoft.eShopOnContainers.Services.Catalog.API.Model; global using Microsoft.eShopOnContainers.Services.Catalog.API.ViewModel; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; global using Microsoft.Extensions.Options; global using Polly; global using Polly.Retry; global using Services.Common; -global using Catalog.API.Apis; diff --git a/src/Services/Identity/Identity.API/Identity.API.csproj b/src/Services/Identity/Identity.API/Identity.API.csproj index 91d74a376..a30105deb 100644 --- a/src/Services/Identity/Identity.API/Identity.API.csproj +++ b/src/Services/Identity/Identity.API/Identity.API.csproj @@ -3,6 +3,7 @@ net7.0 aspnet-eShopOnContainers.Identity-90487118-103c-4ff0-b9da-e5e26f7ab0c5 + enable ..\..\..\..\docker-compose.dcproj diff --git a/src/Services/Ordering/Ordering.API/GlobalUsings.cs b/src/Services/Ordering/Ordering.API/GlobalUsings.cs index d36189d2a..fc2590844 100644 --- a/src/Services/Ordering/Ordering.API/GlobalUsings.cs +++ b/src/Services/Ordering/Ordering.API/GlobalUsings.cs @@ -1,12 +1,6 @@ -global using System; -global using System.Collections.Generic; -global using System.Data.Common; +global using System.Data.Common; global using System.Data.SqlClient; -global using System.IO; -global using System.Linq; global using System.Runtime.Serialization; -global using System.Threading; -global using System.Threading.Tasks; global using Azure.Identity; global using Dapper; global using FluentValidation; @@ -14,9 +8,6 @@ global using Google.Protobuf.Collections; global using Grpc.Core; global using MediatR; global using Microsoft.AspNetCore.Authorization; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.AspNetCore.Hosting; -global using Microsoft.AspNetCore.Http; global using Microsoft.AspNetCore.Mvc; global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore.Design; @@ -45,9 +36,6 @@ global using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; global using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure; global using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency; global using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Repositories; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; global using Microsoft.Extensions.Options; global using Polly; global using Polly.Retry; diff --git a/src/Services/Ordering/Ordering.API/Ordering.API.csproj b/src/Services/Ordering/Ordering.API/Ordering.API.csproj index 0ba10cd65..4585cc4f6 100644 --- a/src/Services/Ordering/Ordering.API/Ordering.API.csproj +++ b/src/Services/Ordering/Ordering.API/Ordering.API.csproj @@ -3,6 +3,7 @@ net7.0 aspnet-Ordering.API-20161122013547 + enable ..\..\..\..\docker-compose.dcproj Microsoft.eShopOnContainers.Services.Ordering.API diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/GlobalUsings.cs b/src/Services/Ordering/Ordering.BackgroundTasks/GlobalUsings.cs index 72205c528..c4d565060 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/GlobalUsings.cs +++ b/src/Services/Ordering/Ordering.BackgroundTasks/GlobalUsings.cs @@ -1,10 +1,8 @@ -global using System; -global using Microsoft.AspNetCore.Builder; +global using Microsoft.AspNetCore.Builder; global using Microsoft.Extensions.Configuration; global using Microsoft.Extensions.DependencyInjection; global using Microsoft.Extensions.Hosting; global using Microsoft.Extensions.Logging; -global using Ordering.BackgroundTasks; global using Ordering.BackgroundTasks.Extensions; global using Ordering.BackgroundTasks.Services; global using Services.Common; diff --git a/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj b/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj index 85328e8bd..eefdf03f4 100644 --- a/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj +++ b/src/Services/Ordering/Ordering.BackgroundTasks/Ordering.BackgroundTasks.csproj @@ -2,6 +2,7 @@ net7.0 + enable dotnet-Ordering.BackgroundTasks-9D3E1DD6-405B-447F-8AAB-1708B36D260E Linux diff --git a/src/Services/Ordering/Ordering.Domain/GlobalUsings.cs b/src/Services/Ordering/Ordering.Domain/GlobalUsings.cs index 33d18f36e..866be7bcb 100644 --- a/src/Services/Ordering/Ordering.Domain/GlobalUsings.cs +++ b/src/Services/Ordering/Ordering.Domain/GlobalUsings.cs @@ -1,12 +1,7 @@ -global using global::Microsoft.eShopOnContainers.Services.Ordering.Domain.Exceptions; +global using System.Reflection; +global using global::Microsoft.eShopOnContainers.Services.Ordering.Domain.Exceptions; global using MediatR; -global using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork; global using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate; global using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; global using Microsoft.eShopOnContainers.Services.Ordering.Domain.Events; -global using System.Collections.Generic; -global using System.Linq; -global using System.Reflection; -global using System.Threading.Tasks; -global using System.Threading; -global using System; \ No newline at end of file +global using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork; diff --git a/src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj b/src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj index e5e86e6a4..a742a7f5a 100644 --- a/src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj +++ b/src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj @@ -2,6 +2,7 @@ net7.0 + enable diff --git a/src/Services/Ordering/Ordering.Infrastructure/GlobalUsings.cs b/src/Services/Ordering/Ordering.Infrastructure/GlobalUsings.cs index d05654f66..dc02c7a6d 100644 --- a/src/Services/Ordering/Ordering.Infrastructure/GlobalUsings.cs +++ b/src/Services/Ordering/Ordering.Infrastructure/GlobalUsings.cs @@ -1,17 +1,12 @@ -global using MediatR; +global using System.Data; +global using MediatR; +global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore.Design; global using Microsoft.EntityFrameworkCore.Metadata.Builders; global using Microsoft.EntityFrameworkCore.Storage; -global using Microsoft.EntityFrameworkCore; global using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate; global using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate; -global using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork; -global using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency; global using Microsoft.eShopOnContainers.Services.Ordering.Domain.Exceptions; +global using Microsoft.eShopOnContainers.Services.Ordering.Domain.Seedwork; global using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.EntityConfigurations; -global using System.Data; -global using System.Linq; -global using System.Threading.Tasks; -global using System.Threading; -global using System; -global using System.Collections.Generic; \ No newline at end of file +global using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency; diff --git a/src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj b/src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj index 4cca96196..d27c1178e 100644 --- a/src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj +++ b/src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj @@ -2,6 +2,7 @@ net7.0 + enable diff --git a/src/Services/Ordering/Ordering.SignalrHub/GlobalUsings.cs b/src/Services/Ordering/Ordering.SignalrHub/GlobalUsings.cs index 16b8b6bda..f5db9ff53 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/GlobalUsings.cs +++ b/src/Services/Ordering/Ordering.SignalrHub/GlobalUsings.cs @@ -1,9 +1,5 @@ -global using System; -global using System.Collections.Generic; -global using System.Threading.Tasks; -global using Microsoft.AspNetCore.Authentication.JwtBearer; +global using Microsoft.AspNetCore.Authentication.JwtBearer; global using Microsoft.AspNetCore.Authorization; -global using Microsoft.AspNetCore.Builder; global using Microsoft.AspNetCore.SignalR; global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; @@ -11,7 +7,4 @@ global using Microsoft.eShopOnContainers.Services.Ordering.SignalrHub; global using Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents; global using Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents.EventHandling; global using Microsoft.eShopOnContainers.Services.Ordering.SignalrHub.IntegrationEvents.Events; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; global using Services.Common; diff --git a/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj b/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj index a870e20ee..f24fd1e05 100644 --- a/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj +++ b/src/Services/Ordering/Ordering.SignalrHub/Ordering.SignalrHub.csproj @@ -2,6 +2,7 @@ net7.0 + enable ..\..\..\..\docker-compose.dcproj diff --git a/src/Services/Payment/Payment.API/GlobalUsings.cs b/src/Services/Payment/Payment.API/GlobalUsings.cs index a29434a61..575aaedc4 100644 --- a/src/Services/Payment/Payment.API/GlobalUsings.cs +++ b/src/Services/Payment/Payment.API/GlobalUsings.cs @@ -1,11 +1,7 @@ -global using System.Threading.Tasks; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; +global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; global using Microsoft.eShopOnContainers.Payment.API; global using Microsoft.eShopOnContainers.Payment.API.IntegrationEvents.EventHandling; global using Microsoft.eShopOnContainers.Payment.API.IntegrationEvents.Events; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; global using Microsoft.Extensions.Options; global using Services.Common; diff --git a/src/Services/Payment/Payment.API/Payment.API.csproj b/src/Services/Payment/Payment.API/Payment.API.csproj index 6dc523a2e..01e401dd1 100644 --- a/src/Services/Payment/Payment.API/Payment.API.csproj +++ b/src/Services/Payment/Payment.API/Payment.API.csproj @@ -2,6 +2,7 @@ net7.0 + enable ..\..\..\..\docker-compose.dcproj diff --git a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs index 2ef5c1bd7..ec333301c 100644 --- a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs +++ b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs @@ -1,26 +1,16 @@ -global using System; -global using System.Collections.Generic; -global using System.ComponentModel.DataAnnotations; +global using System.ComponentModel.DataAnnotations; global using System.Data.Common; global using System.Linq; -global using System.Net; global using System.Net.Http; global using System.Text; global using System.Text.Json; -global using System.Threading.Tasks; global using Microsoft.AspNetCore.Authorization; -global using Microsoft.AspNetCore.Builder; -global using Microsoft.AspNetCore.Hosting; -global using Microsoft.AspNetCore.Http; global using Microsoft.AspNetCore.Mvc; global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore.Design; global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Abstractions; global using Microsoft.eShopOnContainers.BuildingBlocks.EventBus.Events; global using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF.Services; -global using Microsoft.Extensions.Configuration; -global using Microsoft.Extensions.DependencyInjection; -global using Microsoft.Extensions.Logging; global using Services.Common; global using Webhooks.API.Infrastructure; global using Webhooks.API.IntegrationEvents; diff --git a/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj b/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj index 979154074..8183be07c 100644 --- a/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj +++ b/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj @@ -2,6 +2,7 @@ net7.0 + enable Linux diff --git a/src/Tests/Services/Application.FunctionalTests/GlobalUsings.cs b/src/Tests/Services/Application.FunctionalTests/GlobalUsings.cs index a56d1d34b..fa4a33759 100644 --- a/src/Tests/Services/Application.FunctionalTests/GlobalUsings.cs +++ b/src/Tests/Services/Application.FunctionalTests/GlobalUsings.cs @@ -1,14 +1,14 @@ global using System; +global using System.Collections.Generic; +global using System.Linq; global using System.Net.Http; -global using Microsoft.AspNetCore.Http; global using System.Security.Claims; +global using System.Text; +global using System.Text.Json; global using System.Threading.Tasks; +global using Microsoft.AspNetCore.Http; global using Microsoft.eShopOnContainers.Services.Basket.API.Model; global using Microsoft.eShopOnContainers.WebMVC.ViewModels; -global using System.Text.Json; -global using System.Collections.Generic; -global using System.Linq; -global using System.Text; global using WebMVC.Services.ModelDTOs; global using Xunit; diff --git a/src/Web/WebMVC/WebMVC.csproj b/src/Web/WebMVC/WebMVC.csproj index 9d2c7577c..4ac1e4410 100644 --- a/src/Web/WebMVC/WebMVC.csproj +++ b/src/Web/WebMVC/WebMVC.csproj @@ -3,6 +3,7 @@ net7.0 aspnet-Microsoft.eShopOnContainers-946ae052-8305-4a99-965b-ec8636ddbae3 + enable ..\..\..\docker-compose.dcproj 3.0 diff --git a/src/Web/WebStatus/GlobalUsings.cs b/src/Web/WebStatus/GlobalUsings.cs index 0efba33ad..87636feda 100644 --- a/src/Web/WebStatus/GlobalUsings.cs +++ b/src/Web/WebStatus/GlobalUsings.cs @@ -1,13 +1,5 @@ -global using Microsoft.AspNetCore.Mvc; -global using Microsoft.Extensions.Configuration; -global using System.Linq; -global using Microsoft.AspNetCore.Hosting; -global using System; -global using System.Collections.Generic; +global using Azure.Core; global using Azure.Identity; -global using Azure.Core; -global using Microsoft.AspNetCore.Builder; global using Microsoft.AspNetCore.Diagnostics.HealthChecks; -global using Microsoft.Extensions.DependencyInjection; +global using Microsoft.AspNetCore.Mvc; global using Microsoft.Extensions.Diagnostics.HealthChecks; -global using Microsoft.Extensions.Hosting; diff --git a/src/Web/WebStatus/WebStatus.csproj b/src/Web/WebStatus/WebStatus.csproj index 22e65f96b..cb2da89de 100644 --- a/src/Web/WebStatus/WebStatus.csproj +++ b/src/Web/WebStatus/WebStatus.csproj @@ -1,9 +1,9 @@  net7.0 + enable $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; ..\..\..\docker-compose.dcproj - true diff --git a/src/Web/WebhookClient/WebhookClient.csproj b/src/Web/WebhookClient/WebhookClient.csproj index 82bcf6edc..d719322af 100644 --- a/src/Web/WebhookClient/WebhookClient.csproj +++ b/src/Web/WebhookClient/WebhookClient.csproj @@ -2,12 +2,9 @@ net7.0 - InProcess + enable Linux 36215d41-f31a-4aa6-9929-bd67d650e7b5 - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - false - true