From 7c6221cc22d83b5dacc93a2a656d70beb0a686fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onurkan=20Bak=C4=B1rc=C4=B1?= Date: Mon, 21 Mar 2022 15:33:02 +0300 Subject: [PATCH 01/15] Swagger comment support added Catalog, Webhook, Order and Basket services. Swagger and swagger comment support added to Identity Service --- .../Basket/Basket.API/Basket.API.csproj | 5 +++- src/Services/Basket/Basket.API/Startup.cs | 17 ++++++++++++- .../Catalog/Catalog.API/Catalog.API.csproj | 5 +++- src/Services/Catalog/Catalog.API/Startup.cs | 17 ++++++++++++- .../Identity/Identity.API/Identity.API.csproj | 5 ++++ src/Services/Identity/Identity.API/Startup.cs | 25 ++++++++++++++++++- .../Ordering/Ordering.API/Ordering.API.csproj | 5 +++- src/Services/Ordering/Ordering.API/Startup.cs | 19 ++++++++++++-- src/Services/Webhooks/Webhooks.API/Startup.cs | 17 ++++++++++++- .../Webhooks/Webhooks.API/Webhooks.API.csproj | 5 +++- 10 files changed, 110 insertions(+), 10 deletions(-) diff --git a/src/Services/Basket/Basket.API/Basket.API.csproj b/src/Services/Basket/Basket.API/Basket.API.csproj index ebb224824..16d662ea6 100644 --- a/src/Services/Basket/Basket.API/Basket.API.csproj +++ b/src/Services/Basket/Basket.API/Basket.API.csproj @@ -6,7 +6,10 @@ false true - + + true + $(NoWarn);1591 + PreserveNewest diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs index 082560048..cfe95dcc5 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -29,11 +29,26 @@ public class Startup services.AddSwaggerGen(options => { + var basePath = AppDomain.CurrentDomain.BaseDirectory; + var fileName = typeof(Program).GetTypeInfo().Assembly.GetName().Name + ".xml"; + var xmlComments = Path.Combine(basePath, fileName); + options.IncludeXmlComments(xmlComments); options.SwaggerDoc("v1", new OpenApiInfo { Title = "eShopOnContainers - Basket HTTP API", Version = "v1", - Description = "The Basket Service HTTP API" + Description = "The Basket Service HTTP API", + TermsOfService = new Uri("https://microsoft.com/"), + Contact = new OpenApiContact + { + Name = "Microsoft Contact", + Url = new Uri("https://microsoft.com/") + }, + License = new OpenApiLicense + { + Name = "Microsoft License", + Url = new Uri("https://microsoft.com/") + } }); options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme diff --git a/src/Services/Catalog/Catalog.API/Catalog.API.csproj b/src/Services/Catalog/Catalog.API/Catalog.API.csproj index b78ce2af3..7de11b7c2 100644 --- a/src/Services/Catalog/Catalog.API/Catalog.API.csproj +++ b/src/Services/Catalog/Catalog.API/Catalog.API.csproj @@ -11,7 +11,10 @@ false true - + + true + $(NoWarn);1591 + diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index f7b46cb6f..39048cb61 100644 --- a/src/Services/Catalog/Catalog.API/Startup.cs +++ b/src/Services/Catalog/Catalog.API/Startup.cs @@ -222,11 +222,26 @@ public static class CustomExtensionMethods { services.AddSwaggerGen(options => { + var basePath = AppDomain.CurrentDomain.BaseDirectory; + var fileName = typeof(Program).GetTypeInfo().Assembly.GetName().Name + ".xml"; + var xmlComments = Path.Combine(basePath, fileName); + options.IncludeXmlComments(xmlComments); options.SwaggerDoc("v1", new OpenApiInfo { Title = "eShopOnContainers - Catalog HTTP API", Version = "v1", - Description = "The Catalog Microservice HTTP API. This is a Data-Driven/CRUD microservice sample" + Description = "The Catalog Microservice HTTP API. This is a Data-Driven/CRUD microservice sample", + TermsOfService = new Uri("https://microsoft.com/terms"), + Contact = new OpenApiContact + { + Name = "Microsoft Contact", + Url = new Uri("https://microsoft.com/contact") + }, + License = new OpenApiLicense + { + Name = "Microsoft License", + Url = new Uri("https://microsoft.com/license") + } }); }); diff --git a/src/Services/Identity/Identity.API/Identity.API.csproj b/src/Services/Identity/Identity.API/Identity.API.csproj index 0398ccb4b..e484b7730 100644 --- a/src/Services/Identity/Identity.API/Identity.API.csproj +++ b/src/Services/Identity/Identity.API/Identity.API.csproj @@ -8,6 +8,11 @@ true + + true + $(NoWarn);1591 + + PreserveNewest diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index 43662acdd..2528d88a1 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.DataProtection; +using Microsoft.AspNetCore.DataProtection; namespace Microsoft.eShopOnContainers.Services.Identity.API { @@ -89,6 +89,29 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API services.AddControllersWithViews(); services.AddRazorPages(); + var basePath = AppDomain.CurrentDomain.BaseDirectory; + var fileName = typeof(Program).GetTypeInfo().Assembly.GetName().Name + ".xml"; + var xmlComments = Path.Combine(basePath, fileName); + options.IncludeXmlComments(xmlComments); + options.SwaggerDoc("v1", new OpenApiInfo + { + Title = "Microsoft - Identity HTTP API", + Version = "v1", + Description = "The Identity Service HTTP API", + TermsOfService = new Uri("https://microsoft.com/"), + Contact = new OpenApiContact + { + Name = "Microsoft Contact", + Url = new Uri("https://microsoft.com/") + }, + License = new OpenApiLicense + { + Name = "Microsoft License", + Url = new Uri("https://microsoft.com/") + } + }); + }); + var container = new ContainerBuilder(); container.Populate(services); diff --git a/src/Services/Ordering/Ordering.API/Ordering.API.csproj b/src/Services/Ordering/Ordering.API/Ordering.API.csproj index 5b011d037..18b6ea0e8 100644 --- a/src/Services/Ordering/Ordering.API/Ordering.API.csproj +++ b/src/Services/Ordering/Ordering.API/Ordering.API.csproj @@ -8,7 +8,10 @@ false true - + + true + $(NoWarn);1591 + PreserveNewest diff --git a/src/Services/Ordering/Ordering.API/Startup.cs b/src/Services/Ordering/Ordering.API/Startup.cs index 501a55361..c48b77d7e 100644 --- a/src/Services/Ordering/Ordering.API/Startup.cs +++ b/src/Services/Ordering/Ordering.API/Startup.cs @@ -214,12 +214,27 @@ static class CustomExtensionsMethods public static IServiceCollection AddCustomSwagger(this IServiceCollection services, IConfiguration configuration) { services.AddSwaggerGen(options => - { + { + var basePath = AppDomain.CurrentDomain.BaseDirectory; + var fileName = typeof(Program).GetTypeInfo().Assembly.GetName().Name + ".xml"; + var xmlComments = Path.Combine(basePath, fileName); + options.IncludeXmlComments(xmlComments); options.SwaggerDoc("v1", new OpenApiInfo { Title = "eShopOnContainers - Ordering HTTP API", Version = "v1", - Description = "The Ordering Service HTTP API" + Description = "The Ordering Service HTTP API", + TermsOfService = new Uri("https://microsoft.com/terms"), + Contact = new OpenApiContact + { + Name = "Microsoft Contact", + Url = new Uri("https://microsoft.com/") + }, + License = new OpenApiLicense + { + Name = "Microsoft License", + Url = new Uri("https://microsoft.com/") + } }); options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme { diff --git a/src/Services/Webhooks/Webhooks.API/Startup.cs b/src/Services/Webhooks/Webhooks.API/Startup.cs index 256941efa..1d9359ffa 100644 --- a/src/Services/Webhooks/Webhooks.API/Startup.cs +++ b/src/Services/Webhooks/Webhooks.API/Startup.cs @@ -139,11 +139,26 @@ static class CustomExtensionMethods { services.AddSwaggerGen(options => { + var basePath = AppDomain.CurrentDomain.BaseDirectory; + var fileName = typeof(Program).GetTypeInfo().Assembly.GetName().Name + ".xml"; + var xmlComments = Path.Combine(basePath, fileName); + options.IncludeXmlComments(xmlComments); options.SwaggerDoc("v1", new OpenApiInfo { Title = "eShopOnContainers - Webhooks HTTP API", Version = "v1", - Description = "The Webhooks Microservice HTTP API. This is a simple webhooks CRUD registration entrypoint" + Description = "The Webhooks Microservice HTTP API. This is a simple webhooks CRUD registration entrypoint", + TermsOfService = new Uri("https://microsoft.com/"), + Contact = new OpenApiContact + { + Name = "Microsoft Contact", + Url = new Uri("https://microsoft.com/") + }, + License = new OpenApiLicense + { + Name = "Microsoft License", + Url = new Uri("https://microsoft.com/") + } }); options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme diff --git a/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj b/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj index 063a01cf3..98e8efcaf 100644 --- a/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj +++ b/src/Services/Webhooks/Webhooks.API/Webhooks.API.csproj @@ -8,7 +8,10 @@ false true - + + true + $(NoWarn);1591 + From a04a00241bfdac9a4ee7df159267057840b77be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onurkan=20Bak=C4=B1rc=C4=B1?= Date: Mon, 21 Mar 2022 15:44:40 +0300 Subject: [PATCH 02/15] Startup typeof error edited --- src/Services/Basket/Basket.API/Startup.cs | 2 +- src/Services/Catalog/Catalog.API/Startup.cs | 2 +- src/Services/Identity/Identity.API/Startup.cs | 2 +- src/Services/Ordering/Ordering.API/Startup.cs | 2 +- src/Services/Webhooks/Webhooks.API/Startup.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Services/Basket/Basket.API/Startup.cs b/src/Services/Basket/Basket.API/Startup.cs index cfe95dcc5..6e3171bf9 100644 --- a/src/Services/Basket/Basket.API/Startup.cs +++ b/src/Services/Basket/Basket.API/Startup.cs @@ -30,7 +30,7 @@ public class Startup services.AddSwaggerGen(options => { var basePath = AppDomain.CurrentDomain.BaseDirectory; - var fileName = typeof(Program).GetTypeInfo().Assembly.GetName().Name + ".xml"; + var fileName = typeof(Startup).GetTypeInfo().Assembly.GetName().Name + ".xml"; var xmlComments = Path.Combine(basePath, fileName); options.IncludeXmlComments(xmlComments); options.SwaggerDoc("v1", new OpenApiInfo diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index 39048cb61..0f0e75361 100644 --- a/src/Services/Catalog/Catalog.API/Startup.cs +++ b/src/Services/Catalog/Catalog.API/Startup.cs @@ -223,7 +223,7 @@ public static class CustomExtensionMethods services.AddSwaggerGen(options => { var basePath = AppDomain.CurrentDomain.BaseDirectory; - var fileName = typeof(Program).GetTypeInfo().Assembly.GetName().Name + ".xml"; + var fileName = typeof(Startup).GetTypeInfo().Assembly.GetName().Name + ".xml"; var xmlComments = Path.Combine(basePath, fileName); options.IncludeXmlComments(xmlComments); options.SwaggerDoc("v1", new OpenApiInfo diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index 2528d88a1..51b1d4f8e 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -90,7 +90,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API services.AddRazorPages(); var basePath = AppDomain.CurrentDomain.BaseDirectory; - var fileName = typeof(Program).GetTypeInfo().Assembly.GetName().Name + ".xml"; + var fileName = typeof(Startup).GetTypeInfo().Assembly.GetName().Name + ".xml"; var xmlComments = Path.Combine(basePath, fileName); options.IncludeXmlComments(xmlComments); options.SwaggerDoc("v1", new OpenApiInfo diff --git a/src/Services/Ordering/Ordering.API/Startup.cs b/src/Services/Ordering/Ordering.API/Startup.cs index c48b77d7e..b91ed3f8d 100644 --- a/src/Services/Ordering/Ordering.API/Startup.cs +++ b/src/Services/Ordering/Ordering.API/Startup.cs @@ -216,7 +216,7 @@ static class CustomExtensionsMethods services.AddSwaggerGen(options => { var basePath = AppDomain.CurrentDomain.BaseDirectory; - var fileName = typeof(Program).GetTypeInfo().Assembly.GetName().Name + ".xml"; + var fileName = typeof(Startup).GetTypeInfo().Assembly.GetName().Name + ".xml"; var xmlComments = Path.Combine(basePath, fileName); options.IncludeXmlComments(xmlComments); options.SwaggerDoc("v1", new OpenApiInfo diff --git a/src/Services/Webhooks/Webhooks.API/Startup.cs b/src/Services/Webhooks/Webhooks.API/Startup.cs index 1d9359ffa..35ccf8f88 100644 --- a/src/Services/Webhooks/Webhooks.API/Startup.cs +++ b/src/Services/Webhooks/Webhooks.API/Startup.cs @@ -140,7 +140,7 @@ static class CustomExtensionMethods services.AddSwaggerGen(options => { var basePath = AppDomain.CurrentDomain.BaseDirectory; - var fileName = typeof(Program).GetTypeInfo().Assembly.GetName().Name + ".xml"; + var fileName = typeof(Startup).GetTypeInfo().Assembly.GetName().Name + ".xml"; var xmlComments = Path.Combine(basePath, fileName); options.IncludeXmlComments(xmlComments); options.SwaggerDoc("v1", new OpenApiInfo From 3c90301bbbfcdd37873f991cc8b0d9b326e37f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onurkan=20Bak=C4=B1rc=C4=B1?= Date: Mon, 21 Mar 2022 15:53:14 +0300 Subject: [PATCH 03/15] Syntax err edited. --- src/Services/Catalog/Catalog.API/Startup.cs | 1 - src/Services/Identity/Identity.API/Startup.cs | 1 - src/Services/Webhooks/Webhooks.API/Startup.cs | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index 0f0e75361..6320a7091 100644 --- a/src/Services/Catalog/Catalog.API/Startup.cs +++ b/src/Services/Catalog/Catalog.API/Startup.cs @@ -242,7 +242,6 @@ public static class CustomExtensionMethods Name = "Microsoft License", Url = new Uri("https://microsoft.com/license") } - }); }); return services; diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index 51b1d4f8e..2fbcf7feb 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -109,7 +109,6 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API Name = "Microsoft License", Url = new Uri("https://microsoft.com/") } - }); }); var container = new ContainerBuilder(); diff --git a/src/Services/Webhooks/Webhooks.API/Startup.cs b/src/Services/Webhooks/Webhooks.API/Startup.cs index 35ccf8f88..c57f3f962 100644 --- a/src/Services/Webhooks/Webhooks.API/Startup.cs +++ b/src/Services/Webhooks/Webhooks.API/Startup.cs @@ -139,7 +139,7 @@ static class CustomExtensionMethods { services.AddSwaggerGen(options => { - var basePath = AppDomain.CurrentDomain.BaseDirectory; + var basePath = AppDomain.CurrentDomain.BaseDirectory; var fileName = typeof(Startup).GetTypeInfo().Assembly.GetName().Name + ".xml"; var xmlComments = Path.Combine(basePath, fileName); options.IncludeXmlComments(xmlComments); From 913ac777fcd9facff2e8aa46d8a32e01a588b001 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onurkan=20Bak=C4=B1rc=C4=B1?= Date: Mon, 21 Mar 2022 18:02:47 +0300 Subject: [PATCH 04/15] Syntax err updated. --- src/Services/Catalog/Catalog.API/Startup.cs | 3 +- src/Services/Identity/Identity.API/Startup.cs | 28 +++++++++---------- src/Services/Ordering/Ordering.API/Startup.cs | 1 + 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Services/Catalog/Catalog.API/Startup.cs b/src/Services/Catalog/Catalog.API/Startup.cs index 6320a7091..c7fd068c7 100644 --- a/src/Services/Catalog/Catalog.API/Startup.cs +++ b/src/Services/Catalog/Catalog.API/Startup.cs @@ -242,10 +242,9 @@ public static class CustomExtensionMethods Name = "Microsoft License", Url = new Uri("https://microsoft.com/license") } + }); }); - return services; - } public static IServiceCollection AddIntegrationServices(this IServiceCollection services, IConfiguration configuration) diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index 2fbcf7feb..70a667a72 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -95,20 +95,20 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API options.IncludeXmlComments(xmlComments); options.SwaggerDoc("v1", new OpenApiInfo { - Title = "Microsoft - Identity HTTP API", - Version = "v1", - Description = "The Identity Service HTTP API", - TermsOfService = new Uri("https://microsoft.com/"), - Contact = new OpenApiContact - { - Name = "Microsoft Contact", - Url = new Uri("https://microsoft.com/") - }, - License = new OpenApiLicense - { - Name = "Microsoft License", - Url = new Uri("https://microsoft.com/") - } + Title = "Microsoft - Identity HTTP API", + Version = "v1", + Description = "The Identity Service HTTP API", + TermsOfService = new Uri("https://microsoft.com/"), + Contact = new OpenApiContact + { + Name = "Microsoft Contact", + Url = new Uri("https://microsoft.com/") + }, + License = new OpenApiLicense + { + Name = "Microsoft License", + Url = new Uri("https://microsoft.com/") + } }); var container = new ContainerBuilder(); diff --git a/src/Services/Ordering/Ordering.API/Startup.cs b/src/Services/Ordering/Ordering.API/Startup.cs index b91ed3f8d..0cbd5b0a0 100644 --- a/src/Services/Ordering/Ordering.API/Startup.cs +++ b/src/Services/Ordering/Ordering.API/Startup.cs @@ -236,6 +236,7 @@ static class CustomExtensionsMethods Url = new Uri("https://microsoft.com/") } }); + options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme { Type = SecuritySchemeType.OAuth2, From 27803b3a6b2b76938576152ff66d2bd36c70caf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onurkan=20Bak=C4=B1rc=C4=B1?= Date: Mon, 21 Mar 2022 18:21:46 +0300 Subject: [PATCH 05/15] Syntax updated --- src/Services/Basket/Basket.API/GlobalUsings.cs | 3 ++- src/Services/Identity/Identity.API/GlobalUsings.cs | 1 + src/Services/Webhooks/Webhooks.API/GlobalUsings.cs | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Services/Basket/Basket.API/GlobalUsings.cs b/src/Services/Basket/Basket.API/GlobalUsings.cs index 75f7a878e..b6eecbc48 100644 --- a/src/Services/Basket/Basket.API/GlobalUsings.cs +++ b/src/Services/Basket/Basket.API/GlobalUsings.cs @@ -58,4 +58,5 @@ global using System.Net; global using System.Security.Claims; global using System.Text.Json; global using System.Threading.Tasks; -global using System; \ No newline at end of file +global using System; +global using System.Reflection; \ No newline at end of file diff --git a/src/Services/Identity/Identity.API/GlobalUsings.cs b/src/Services/Identity/Identity.API/GlobalUsings.cs index bfbb354db..012501072 100644 --- a/src/Services/Identity/Identity.API/GlobalUsings.cs +++ b/src/Services/Identity/Identity.API/GlobalUsings.cs @@ -58,6 +58,7 @@ global using System.Security.Cryptography.X509Certificates; global using System.Text.RegularExpressions; global using System.Threading.Tasks; global using System; +global using System.Reflection; diff --git a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs index c575b7235..42d66557d 100644 --- a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs +++ b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs @@ -48,3 +48,4 @@ global using Webhooks.API.IntegrationEvents; global using Webhooks.API.Model; global using Webhooks.API.Services; global using Webhooks.API; +global using System.Reflection; From c1b726c62f8521a51143be3910514ef636951f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onurkan=20Bak=C4=B1rc=C4=B1?= Date: Mon, 21 Mar 2022 18:26:58 +0300 Subject: [PATCH 06/15] Namespaces added. --- src/Services/Identity/Identity.API/GlobalUsings.cs | 2 ++ src/Services/Webhooks/Webhooks.API/GlobalUsings.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Services/Identity/Identity.API/GlobalUsings.cs b/src/Services/Identity/Identity.API/GlobalUsings.cs index 012501072..57801a3cb 100644 --- a/src/Services/Identity/Identity.API/GlobalUsings.cs +++ b/src/Services/Identity/Identity.API/GlobalUsings.cs @@ -59,6 +59,8 @@ global using System.Text.RegularExpressions; global using System.Threading.Tasks; global using System; global using System.Reflection; +global using Microsoft.OpenApi.Models; + diff --git a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs index 42d66557d..108159e96 100644 --- a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs +++ b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs @@ -49,3 +49,5 @@ global using Webhooks.API.Model; global using Webhooks.API.Services; global using Webhooks.API; global using System.Reflection; +global using Microsoft.OpenApi.Models; + From 5c17893decfb8108e8c43c2baee8420380856029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onurkan=20Bak=C4=B1rc=C4=B1?= Date: Mon, 21 Mar 2022 18:34:47 +0300 Subject: [PATCH 07/15] Namespaces appended. --- src/Services/Identity/Identity.API/GlobalUsings.cs | 2 +- src/Services/Webhooks/Webhooks.API/GlobalUsings.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Services/Identity/Identity.API/GlobalUsings.cs b/src/Services/Identity/Identity.API/GlobalUsings.cs index 57801a3cb..88252e875 100644 --- a/src/Services/Identity/Identity.API/GlobalUsings.cs +++ b/src/Services/Identity/Identity.API/GlobalUsings.cs @@ -60,7 +60,7 @@ global using System.Threading.Tasks; global using System; global using System.Reflection; global using Microsoft.OpenApi.Models; - +global using Sytem.IO.Path; diff --git a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs index 108159e96..db3a13633 100644 --- a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs +++ b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs @@ -50,4 +50,5 @@ global using Webhooks.API.Services; global using Webhooks.API; global using System.Reflection; global using Microsoft.OpenApi.Models; +global using Sytem.IO.Path; From 1e997772f3b47712e441ece35d7683164d6d0442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onurkan=20Bak=C4=B1rc=C4=B1?= Date: Mon, 21 Mar 2022 18:38:18 +0300 Subject: [PATCH 08/15] Namespaces added. --- src/Services/Identity/Identity.API/GlobalUsings.cs | 2 +- src/Services/Webhooks/Webhooks.API/GlobalUsings.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Services/Identity/Identity.API/GlobalUsings.cs b/src/Services/Identity/Identity.API/GlobalUsings.cs index 88252e875..83a016497 100644 --- a/src/Services/Identity/Identity.API/GlobalUsings.cs +++ b/src/Services/Identity/Identity.API/GlobalUsings.cs @@ -61,7 +61,7 @@ global using System; global using System.Reflection; global using Microsoft.OpenApi.Models; global using Sytem.IO.Path; - +global using Sytem; diff --git a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs index db3a13633..ab579dfd2 100644 --- a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs +++ b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs @@ -51,4 +51,5 @@ global using Webhooks.API; global using System.Reflection; global using Microsoft.OpenApi.Models; global using Sytem.IO.Path; +global using Sytem; From fb5916d11094ec331d23439b777449106e7a4005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onurkan=20Bak=C4=B1rc=C4=B1?= Date: Mon, 21 Mar 2022 18:42:20 +0300 Subject: [PATCH 09/15] Syntax err updated. --- src/Services/Identity/Identity.API/GlobalUsings.cs | 2 +- src/Services/Webhooks/Webhooks.API/GlobalUsings.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Services/Identity/Identity.API/GlobalUsings.cs b/src/Services/Identity/Identity.API/GlobalUsings.cs index 83a016497..8c5ac350f 100644 --- a/src/Services/Identity/Identity.API/GlobalUsings.cs +++ b/src/Services/Identity/Identity.API/GlobalUsings.cs @@ -61,7 +61,7 @@ global using System; global using System.Reflection; global using Microsoft.OpenApi.Models; global using Sytem.IO.Path; -global using Sytem; +global using System; diff --git a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs index ab579dfd2..e440df0ec 100644 --- a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs +++ b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs @@ -51,5 +51,5 @@ global using Webhooks.API; global using System.Reflection; global using Microsoft.OpenApi.Models; global using Sytem.IO.Path; -global using Sytem; +global using System; From e6784ac8629b7a9c803a7156d774ecd4d3828504 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onurkan=20Bak=C4=B1rc=C4=B1?= Date: Tue, 22 Mar 2022 00:47:06 +0300 Subject: [PATCH 10/15] Dublicated namespaces deleted. --- src/Services/Identity/Identity.API/GlobalUsings.cs | 1 - src/Services/Webhooks/Webhooks.API/GlobalUsings.cs | 1 - 2 files changed, 2 deletions(-) diff --git a/src/Services/Identity/Identity.API/GlobalUsings.cs b/src/Services/Identity/Identity.API/GlobalUsings.cs index 8c5ac350f..867068f1f 100644 --- a/src/Services/Identity/Identity.API/GlobalUsings.cs +++ b/src/Services/Identity/Identity.API/GlobalUsings.cs @@ -61,7 +61,6 @@ global using System; global using System.Reflection; global using Microsoft.OpenApi.Models; global using Sytem.IO.Path; -global using System; diff --git a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs index e440df0ec..db3a13633 100644 --- a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs +++ b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs @@ -51,5 +51,4 @@ global using Webhooks.API; global using System.Reflection; global using Microsoft.OpenApi.Models; global using Sytem.IO.Path; -global using System; From af060620c8e50e7c8224dfbeb5360d5b5c466c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onurkan=20Bak=C4=B1rc=C4=B1?= Date: Tue, 22 Mar 2022 00:52:34 +0300 Subject: [PATCH 11/15] Spelling mistakes edited. --- src/Services/Webhooks/Webhooks.API/GlobalUsings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs index db3a13633..8976a1d32 100644 --- a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs +++ b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs @@ -50,5 +50,5 @@ global using Webhooks.API.Services; global using Webhooks.API; global using System.Reflection; global using Microsoft.OpenApi.Models; -global using Sytem.IO.Path; +global using System.IO.Path; From ce22713dd6e1703238ddedbe20e27143ce49af0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onurkan=20Bak=C4=B1rc=C4=B1?= Date: Tue, 22 Mar 2022 00:56:07 +0300 Subject: [PATCH 12/15] Spelling mistakes updated. --- src/Services/Identity/Identity.API/GlobalUsings.cs | 2 +- src/Services/Webhooks/Webhooks.API/GlobalUsings.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Services/Identity/Identity.API/GlobalUsings.cs b/src/Services/Identity/Identity.API/GlobalUsings.cs index 867068f1f..b96eff851 100644 --- a/src/Services/Identity/Identity.API/GlobalUsings.cs +++ b/src/Services/Identity/Identity.API/GlobalUsings.cs @@ -60,7 +60,7 @@ global using System.Threading.Tasks; global using System; global using System.Reflection; global using Microsoft.OpenApi.Models; -global using Sytem.IO.Path; +global using System.IO; diff --git a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs index 8976a1d32..cd5624bad 100644 --- a/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs +++ b/src/Services/Webhooks/Webhooks.API/GlobalUsings.cs @@ -50,5 +50,5 @@ global using Webhooks.API.Services; global using Webhooks.API; global using System.Reflection; global using Microsoft.OpenApi.Models; -global using System.IO.Path; +global using System.IO; From a73876995085bfb5aa7f6e1929764320e1a9ec68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onurkan=20Bak=C4=B1rc=C4=B1?= Date: Tue, 22 Mar 2022 01:00:36 +0300 Subject: [PATCH 13/15] Identity server syntax err edited. --- src/Services/Identity/Identity.API/Startup.cs | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index 70a667a72..8fded06ba 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -89,28 +89,30 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API services.AddControllersWithViews(); services.AddRazorPages(); - var basePath = AppDomain.CurrentDomain.BaseDirectory; - var fileName = typeof(Startup).GetTypeInfo().Assembly.GetName().Name + ".xml"; - var xmlComments = Path.Combine(basePath, fileName); - options.IncludeXmlComments(xmlComments); - options.SwaggerDoc("v1", new OpenApiInfo - { - Title = "Microsoft - Identity HTTP API", - Version = "v1", - Description = "The Identity Service HTTP API", - TermsOfService = new Uri("https://microsoft.com/"), - Contact = new OpenApiContact - { - Name = "Microsoft Contact", - Url = new Uri("https://microsoft.com/") - }, - License = new OpenApiLicense + services.AddSwaggerGen(options => + { + var basePath = AppDomain.CurrentDomain.BaseDirectory; + var fileName = typeof(Startup).GetTypeInfo().Assembly.GetName().Name + ".xml"; + var xmlComments = Path.Combine(basePath, fileName); + options.IncludeXmlComments(xmlComments); + options.SwaggerDoc("v1", new OpenApiInfo { - Name = "Microsoft License", - Url = new Uri("https://microsoft.com/") - } - }); - + Title = "Microsoft - Identity HTTP API", + Version = "v1", + Description = "The Identity Service HTTP API", + TermsOfService = new Uri("https://microsoft.com/"), + Contact = new OpenApiContact + { + Name = "Microsoft Contact", + Url = new Uri("https://microsoft.com/") + }, + License = new OpenApiLicense + { + Name = "Microsoft License", + Url = new Uri("https://microsoft.com/") + } + }); + } var container = new ContainerBuilder(); container.Populate(services); From 948750303bbe534424432e885ed04acc77be5764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onurkan=20Bak=C4=B1rc=C4=B1?= Date: Tue, 22 Mar 2022 01:01:00 +0300 Subject: [PATCH 14/15] Syntax err edited. --- src/Services/Identity/Identity.API/Startup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Services/Identity/Identity.API/Startup.cs b/src/Services/Identity/Identity.API/Startup.cs index 8fded06ba..1b902e246 100644 --- a/src/Services/Identity/Identity.API/Startup.cs +++ b/src/Services/Identity/Identity.API/Startup.cs @@ -112,7 +112,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API Url = new Uri("https://microsoft.com/") } }); - } + }); var container = new ContainerBuilder(); container.Populate(services); From f8d45ee1d4b6e82ee212ee31ae75bbe30e07fb29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onurkan=20Bak=C4=B1rc=C4=B1?= Date: Fri, 8 Apr 2022 15:51:53 +0300 Subject: [PATCH 15/15] Ordering.Api Mediator pipeline error solved --- .../Ordering.API/Application/Behaviors/TransactionBehaviour.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Services/Ordering/Ordering.API/Application/Behaviors/TransactionBehaviour.cs b/src/Services/Ordering/Ordering.API/Application/Behaviors/TransactionBehaviour.cs index 0417d40f6..21117d730 100644 --- a/src/Services/Ordering/Ordering.API/Application/Behaviors/TransactionBehaviour.cs +++ b/src/Services/Ordering/Ordering.API/Application/Behaviors/TransactionBehaviour.cs @@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging; public class TransactionBehaviour : IPipelineBehavior + where TRequest : IRequest { private readonly ILogger> _logger; private readonly OrderingContext _dbContext;