Merge f8d45ee1d4b6e82ee212ee31ae75bbe30e07fb29 into 3af71331570358091794154d372718bc10c1a6b7

This commit is contained in:
Onurkan Bakırcı 2022-04-08 12:51:58 +00:00 committed by GitHub
commit 70ea08d56e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 122 additions and 14 deletions

View File

@ -6,7 +6,10 @@
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks> <GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled> <IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Content Update="web.config"> <Content Update="web.config">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>

View File

@ -58,4 +58,5 @@ global using System.Net;
global using System.Security.Claims; global using System.Security.Claims;
global using System.Text.Json; global using System.Text.Json;
global using System.Threading.Tasks; global using System.Threading.Tasks;
global using System; global using System;
global using System.Reflection;

View File

@ -29,11 +29,26 @@ public class Startup
services.AddSwaggerGen(options => 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 options.SwaggerDoc("v1", new OpenApiInfo
{ {
Title = "eShopOnContainers - Basket HTTP API", Title = "eShopOnContainers - Basket HTTP API",
Version = "v1", 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 options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme

View File

@ -11,7 +11,10 @@
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks> <GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled> <IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Content Update="appsettings.json"> <Content Update="appsettings.json">

View File

@ -222,16 +222,29 @@ public static class CustomExtensionMethods
{ {
services.AddSwaggerGen(options => 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 options.SwaggerDoc("v1", new OpenApiInfo
{ {
Title = "eShopOnContainers - Catalog HTTP API", Title = "eShopOnContainers - Catalog HTTP API",
Version = "v1", 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")
}
}); });
}); });
return services; return services;
} }
public static IServiceCollection AddIntegrationServices(this IServiceCollection services, IConfiguration configuration) public static IServiceCollection AddIntegrationServices(this IServiceCollection services, IConfiguration configuration)

View File

@ -58,7 +58,9 @@ global using System.Security.Cryptography.X509Certificates;
global using System.Text.RegularExpressions; global using System.Text.RegularExpressions;
global using System.Threading.Tasks; global using System.Threading.Tasks;
global using System; global using System;
global using System.Reflection;
global using Microsoft.OpenApi.Models;
global using System.IO;

View File

@ -8,6 +8,11 @@
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled> <IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Content Include="Setup\**\*;"> <Content Include="Setup\**\*;">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>

View File

@ -1,4 +1,4 @@
using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.DataProtection;
namespace Microsoft.eShopOnContainers.Services.Identity.API namespace Microsoft.eShopOnContainers.Services.Identity.API
{ {
@ -89,6 +89,30 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
services.AddControllersWithViews(); services.AddControllersWithViews();
services.AddRazorPages(); services.AddRazorPages();
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
{
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(); var container = new ContainerBuilder();
container.Populate(services); container.Populate(services);

View File

@ -3,6 +3,7 @@
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
public class TransactionBehaviour<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse> public class TransactionBehaviour<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse>
where TRequest : IRequest<TResponse>
{ {
private readonly ILogger<TransactionBehaviour<TRequest, TResponse>> _logger; private readonly ILogger<TransactionBehaviour<TRequest, TResponse>> _logger;
private readonly OrderingContext _dbContext; private readonly OrderingContext _dbContext;

View File

@ -8,7 +8,10 @@
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks> <GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled> <IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Content Update="web.config;"> <Content Update="web.config;">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>

View File

@ -214,13 +214,29 @@ static class CustomExtensionsMethods
public static IServiceCollection AddCustomSwagger(this IServiceCollection services, IConfiguration configuration) public static IServiceCollection AddCustomSwagger(this IServiceCollection services, IConfiguration configuration)
{ {
services.AddSwaggerGen(options => 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 options.SwaggerDoc("v1", new OpenApiInfo
{ {
Title = "eShopOnContainers - Ordering HTTP API", Title = "eShopOnContainers - Ordering HTTP API",
Version = "v1", 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 options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme
{ {
Type = SecuritySchemeType.OAuth2, Type = SecuritySchemeType.OAuth2,

View File

@ -48,3 +48,7 @@ global using Webhooks.API.IntegrationEvents;
global using Webhooks.API.Model; global using Webhooks.API.Model;
global using Webhooks.API.Services; global using Webhooks.API.Services;
global using Webhooks.API; global using Webhooks.API;
global using System.Reflection;
global using Microsoft.OpenApi.Models;
global using System.IO;

View File

@ -139,11 +139,26 @@ static class CustomExtensionMethods
{ {
services.AddSwaggerGen(options => 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 options.SwaggerDoc("v1", new OpenApiInfo
{ {
Title = "eShopOnContainers - Webhooks HTTP API", Title = "eShopOnContainers - Webhooks HTTP API",
Version = "v1", 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 options.AddSecurityDefinition("oauth2", new OpenApiSecurityScheme

View File

@ -8,7 +8,10 @@
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks> <GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled> <IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="5.0.1" /> <PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="5.0.1" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="5.0.1" /> <PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="5.0.1" />