Merge pull request #2 from borjasanes/feature/ordering-api-migration
Feature/ordering api migration
This commit is contained in:
commit
85e901d857
@ -11,31 +11,24 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services
|
|||||||
{
|
{
|
||||||
public class OrderingService : IOrderingService
|
public class OrderingService : IOrderingService
|
||||||
{
|
{
|
||||||
private readonly HttpClient _httpClient;
|
private readonly OrderingGrpc.OrderingGrpcClient _orderingGrpcClient;
|
||||||
private readonly UrlsConfig _urls;
|
|
||||||
private readonly ILogger<OrderingService> _logger;
|
private readonly ILogger<OrderingService> _logger;
|
||||||
|
|
||||||
public OrderingService(HttpClient httpClient, IOptions<UrlsConfig> config, ILogger<OrderingService> logger)
|
public OrderingService(OrderingGrpc.OrderingGrpcClient orderingGrpcClient, ILogger<OrderingService> logger)
|
||||||
{
|
{
|
||||||
_httpClient = httpClient;
|
_orderingGrpcClient = orderingGrpcClient;
|
||||||
_urls = config.Value;
|
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<OrderData> GetOrderDraftAsync(BasketData basketData)
|
public async Task<OrderData> GetOrderDraftAsync(BasketData basketData)
|
||||||
{
|
{
|
||||||
|
_logger.LogDebug(" grpc client created, basketData={@basketData}", basketData);
|
||||||
|
|
||||||
return await GrpcCallerService.CallService(_urls.GrpcOrdering, async channel =>
|
var command = MapToOrderDraftCommand(basketData);
|
||||||
{
|
var response = await _orderingGrpcClient.CreateOrderDraftFromBasketDataAsync(command);
|
||||||
var client = new OrderingGrpc.OrderingGrpcClient(channel);
|
_logger.LogDebug(" grpc response: {@response}", response);
|
||||||
_logger.LogDebug(" grpc client created, basketData={@basketData}", basketData);
|
|
||||||
|
|
||||||
var command = MapToOrderDraftCommand(basketData);
|
return MapToResponse(response, basketData);
|
||||||
var response = await client.CreateOrderDraftFromBasketDataAsync(command);
|
|
||||||
_logger.LogDebug(" grpc response: {@response}", response);
|
|
||||||
|
|
||||||
return MapToResponse(response, basketData);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private OrderData MapToResponse(GrpcOrdering.OrderDraftDTO orderDraft, BasketData basketData)
|
private OrderData MapToResponse(GrpcOrdering.OrderDraftDTO orderDraft, BasketData basketData)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using Devspaces.Support;
|
using Devspaces.Support;
|
||||||
using GrpcBasket;
|
using GrpcBasket;
|
||||||
|
using GrpcOrdering;
|
||||||
using HealthChecks.UI.Client;
|
using HealthChecks.UI.Client;
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
@ -187,9 +188,6 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
|
|||||||
services.AddHttpClient<IOrderApiClient, OrderApiClient>()
|
services.AddHttpClient<IOrderApiClient, OrderApiClient>()
|
||||||
.AddDevspacesSupport();
|
.AddDevspacesSupport();
|
||||||
|
|
||||||
services.AddHttpClient<IOrderingService, OrderingService>()
|
|
||||||
.AddDevspacesSupport();
|
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,6 +203,14 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
|
|||||||
options.Address = new Uri(basketApi);
|
options.Address = new Uri(basketApi);
|
||||||
}).AddInterceptor<GrpcExceptionInterceptor>();
|
}).AddInterceptor<GrpcExceptionInterceptor>();
|
||||||
|
|
||||||
|
services.AddScoped<IOrderingService, OrderingService>();
|
||||||
|
|
||||||
|
services.AddGrpcClient<OrderingGrpc.OrderingGrpcClient>((services, options) =>
|
||||||
|
{
|
||||||
|
var orderingApi = services.GetRequiredService<IOptions<UrlsConfig>>().Value.GrpcOrdering;
|
||||||
|
options.Address = new Uri(orderingApi);
|
||||||
|
}).AddInterceptor<GrpcExceptionInterceptor>();
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using GrpcOrdering;
|
using GrpcOrdering;
|
||||||
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config;
|
|
||||||
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models;
|
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models;
|
||||||
|
using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -11,30 +11,24 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services
|
|||||||
{
|
{
|
||||||
public class OrderingService : IOrderingService
|
public class OrderingService : IOrderingService
|
||||||
{
|
{
|
||||||
private readonly UrlsConfig _urls;
|
private readonly OrderingGrpc.OrderingGrpcClient _orderingGrpcClient;
|
||||||
private readonly ILogger<OrderingService> _logger;
|
private readonly ILogger<OrderingService> _logger;
|
||||||
public readonly HttpClient _httpClient;
|
|
||||||
|
|
||||||
public OrderingService(HttpClient httpClient, IOptions<UrlsConfig> config, ILogger<OrderingService> logger)
|
public OrderingService(OrderingGrpc.OrderingGrpcClient orderingGrpcClient, ILogger<OrderingService> logger)
|
||||||
{
|
{
|
||||||
_urls = config.Value;
|
_orderingGrpcClient = orderingGrpcClient;
|
||||||
_httpClient = httpClient;
|
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<OrderData> GetOrderDraftAsync(BasketData basketData)
|
public async Task<OrderData> GetOrderDraftAsync(BasketData basketData)
|
||||||
{
|
{
|
||||||
return await GrpcCallerService.CallService(_urls.GrpcOrdering, async channel =>
|
_logger.LogDebug(" grpc client created, basketData={@basketData}", basketData);
|
||||||
{
|
|
||||||
var client = new OrderingGrpc.OrderingGrpcClient(channel);
|
|
||||||
_logger.LogDebug(" grpc client created, basketData={@basketData}", basketData);
|
|
||||||
|
|
||||||
var command = MapToOrderDraftCommand(basketData);
|
var command = MapToOrderDraftCommand(basketData);
|
||||||
var response = await client.CreateOrderDraftFromBasketDataAsync(command);
|
var response = await _orderingGrpcClient.CreateOrderDraftFromBasketDataAsync(command);
|
||||||
_logger.LogDebug(" grpc response: {@response}", response);
|
_logger.LogDebug(" grpc response: {@response}", response);
|
||||||
|
|
||||||
return MapToResponse(response, basketData);
|
return MapToResponse(response, basketData);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private OrderData MapToResponse(GrpcOrdering.OrderDraftDTO orderDraft, BasketData basketData)
|
private OrderData MapToResponse(GrpcOrdering.OrderDraftDTO orderDraft, BasketData basketData)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using Devspaces.Support;
|
using Devspaces.Support;
|
||||||
using GrpcBasket;
|
using GrpcBasket;
|
||||||
|
using GrpcOrdering;
|
||||||
using HealthChecks.UI.Client;
|
using HealthChecks.UI.Client;
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
@ -191,10 +192,6 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator
|
|||||||
.AddHttpMessageHandler<HttpClientAuthorizationDelegatingHandler>()
|
.AddHttpMessageHandler<HttpClientAuthorizationDelegatingHandler>()
|
||||||
.AddDevspacesSupport();
|
.AddDevspacesSupport();
|
||||||
|
|
||||||
services.AddHttpClient<IOrderingService, OrderingService>()
|
|
||||||
.AddHttpMessageHandler<HttpClientAuthorizationDelegatingHandler>()
|
|
||||||
.AddDevspacesSupport();
|
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,6 +207,14 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator
|
|||||||
options.Address = new Uri(basketApi);
|
options.Address = new Uri(basketApi);
|
||||||
}).AddInterceptor<GrpcExceptionInterceptor>();
|
}).AddInterceptor<GrpcExceptionInterceptor>();
|
||||||
|
|
||||||
|
services.AddScoped<IOrderingService, OrderingService>();
|
||||||
|
|
||||||
|
services.AddGrpcClient<OrderingGrpc.OrderingGrpcClient>((services, options) =>
|
||||||
|
{
|
||||||
|
var orderingApi = services.GetRequiredService<IOptions<UrlsConfig>>().Value.GrpcOrdering;
|
||||||
|
options.Address = new Uri(orderingApi);
|
||||||
|
}).AddInterceptor<GrpcExceptionInterceptor>();
|
||||||
|
|
||||||
return services;
|
return services;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,19 +89,19 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class OrderItemDTO
|
public record OrderItemDTO
|
||||||
{
|
{
|
||||||
public int ProductId { get; set; }
|
public int ProductId { get; init; }
|
||||||
|
|
||||||
public string ProductName { get; set; }
|
public string ProductName { get; init; }
|
||||||
|
|
||||||
public decimal UnitPrice { get; set; }
|
public decimal UnitPrice { get; init; }
|
||||||
|
|
||||||
public decimal Discount { get; set; }
|
public decimal Discount { get; init; }
|
||||||
|
|
||||||
public int Units { get; set; }
|
public int Units { get; init; }
|
||||||
|
|
||||||
public string PictureUrl { get; set; }
|
public string PictureUrl { get; init; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
using global::Ordering.API.Application.Models;
|
using global::Ordering.API.Application.Models;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Services;
|
using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Services;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@ -42,10 +41,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class OrderDraftDTO
|
public record OrderDraftDTO
|
||||||
{
|
{
|
||||||
public IEnumerable<OrderItemDTO> OrderItems { get; set; }
|
public IEnumerable<OrderItemDTO> OrderItems { get; init; }
|
||||||
public decimal Total { get; set; }
|
public decimal Total { get; init; }
|
||||||
|
|
||||||
public static OrderDraftDTO FromOrder(Order order)
|
public static OrderDraftDTO FromOrder(Order order)
|
||||||
{
|
{
|
||||||
|
@ -7,12 +7,12 @@ namespace Ordering.API.Application.Models
|
|||||||
{
|
{
|
||||||
public class BasketItem
|
public class BasketItem
|
||||||
{
|
{
|
||||||
public string Id { get; set; }
|
public string Id { get; init; }
|
||||||
public int ProductId { get; set; }
|
public int ProductId { get; init; }
|
||||||
public string ProductName { get; set; }
|
public string ProductName { get; init; }
|
||||||
public decimal UnitPrice { get; set; }
|
public decimal UnitPrice { get; init; }
|
||||||
public decimal OldUnitPrice { get; set; }
|
public decimal OldUnitPrice { get; init; }
|
||||||
public int Quantity { get; set; }
|
public int Quantity { get; init; }
|
||||||
public string PictureUrl { get; set; }
|
public string PictureUrl { get; init; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,39 +3,39 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Queries
|
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Queries
|
||||||
{
|
{
|
||||||
public class Orderitem
|
public record Orderitem
|
||||||
{
|
{
|
||||||
public string productname { get; set; }
|
public string productname { get; init; }
|
||||||
public int units { get; set; }
|
public int units { get; init; }
|
||||||
public double unitprice { get; set; }
|
public double unitprice { get; init; }
|
||||||
public string pictureurl { get; set; }
|
public string pictureurl { get; init; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Order
|
public record Order
|
||||||
{
|
{
|
||||||
public int ordernumber { get; set; }
|
public int ordernumber { get; init; }
|
||||||
public DateTime date { get; set; }
|
public DateTime date { get; init; }
|
||||||
public string status { get; set; }
|
public string status { get; init; }
|
||||||
public string description { get; set; }
|
public string description { get; init; }
|
||||||
public string street { get; set; }
|
public string street { get; init; }
|
||||||
public string city { get; set; }
|
public string city { get; init; }
|
||||||
public string zipcode { get; set; }
|
public string zipcode { get; init; }
|
||||||
public string country { get; set; }
|
public string country { get; init; }
|
||||||
public List<Orderitem> orderitems { get; set; }
|
public List<Orderitem> orderitems { get; set; }
|
||||||
public decimal total { get; set; }
|
public decimal total { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class OrderSummary
|
public record OrderSummary
|
||||||
{
|
{
|
||||||
public int ordernumber { get; set; }
|
public int ordernumber { get; init; }
|
||||||
public DateTime date { get; set; }
|
public DateTime date { get; init; }
|
||||||
public string status { get; set; }
|
public string status { get; init; }
|
||||||
public double total { get; set; }
|
public double total { get; init; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CardType
|
public record CardType
|
||||||
{
|
{
|
||||||
public int Id { get; set; }
|
public int Id { get; init; }
|
||||||
public string Name { get; set; }
|
public string Name { get; init; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
|
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
<UserSecretsId>aspnet-Ordering.API-20161122013547</UserSecretsId>
|
<UserSecretsId>aspnet-Ordering.API-20161122013547</UserSecretsId>
|
||||||
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
|
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81;</AssetTargetFallback>
|
||||||
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||||
@ -37,36 +37,36 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.AzureServiceBus" Version="3.0.0" />
|
<PackageReference Include="AspNetCore.HealthChecks.AzureServiceBus" Version="3.2.2" />
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.Rabbitmq" Version="3.0.3" />
|
<PackageReference Include="AspNetCore.HealthChecks.Rabbitmq" Version="3.1.4" />
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="3.0.0" />
|
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="3.2.0" />
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="3.0.0" />
|
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="3.1.2" />
|
||||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="5.0.1" />
|
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
|
||||||
<PackageReference Include="Dapper" Version="2.0.30" />
|
<PackageReference Include="Dapper" Version="2.0.78" />
|
||||||
<PackageReference Include="FluentValidation.AspNetCore" Version="8.6.0" />
|
<PackageReference Include="FluentValidation.AspNetCore" Version="9.3.0" />
|
||||||
<PackageReference Include="Google.Protobuf" Version="3.11.2" />
|
<PackageReference Include="Google.Protobuf" Version="3.14.0" />
|
||||||
<PackageReference Include="Grpc.AspNetCore.Server" Version="2.25.0" />
|
<PackageReference Include="Grpc.AspNetCore.Server" Version="2.34.0" />
|
||||||
<PackageReference Include="Grpc.Tools" Version="2.25.0" PrivateAssets="All" />
|
<PackageReference Include="Grpc.Tools" Version="2.34.0" PrivateAssets="All" />
|
||||||
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="7.0.0" />
|
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" />
|
||||||
<PackageReference Include="MediatR" Version="7.0.0" />
|
<PackageReference Include="MediatR" Version="9.0.0" />
|
||||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.12.0" />
|
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.16.0" />
|
||||||
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.12.0" />
|
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.16.0" />
|
||||||
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.1.1" />
|
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.1.3" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.HealthChecks" Version="1.0.0" />
|
<PackageReference Include="Microsoft.AspNetCore.HealthChecks" Version="1.0.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.1.0" />
|
<PackageReference Include="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.1.10" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="3.1.0" />
|
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="5.0.1" />
|
||||||
<PackageReference Include="Microsoft.NETCore.Platforms" Version="3.1.0" />
|
<PackageReference Include="Microsoft.NETCore.Platforms" Version="5.0.0" />
|
||||||
<PackageReference Include="Polly" Version="7.2.0" />
|
<PackageReference Include="Polly" Version="7.2.1" />
|
||||||
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
|
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
|
||||||
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.1.3" />
|
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.1.3" />
|
||||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.1-dev-00216" />
|
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.1-dev-00216" />
|
||||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0-dev-00834" />
|
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0-dev-00834" />
|
||||||
<PackageReference Include="Serilog.Sinks.Http" Version="5.2.0" />
|
<PackageReference Include="Serilog.Sinks.Http" Version="7.2.0" />
|
||||||
<PackageReference Include="Serilog.Sinks.Seq" Version="4.1.0-dev-00166" />
|
<PackageReference Include="Serilog.Sinks.Seq" Version="4.1.0-dev-00166" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.0.0-rc5" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
|
||||||
<PackageReference Include="System.Reflection" Version="4.4.0-beta-24913-02" />
|
<PackageReference Include="System.Reflection" Version="4.4.0-beta-24913-02" />
|
||||||
<PackageReference Include="System.ValueTuple" Version="4.6.0-preview1-26829-04" />
|
<PackageReference Include="System.ValueTuple" Version="4.6.0-preview1-26829-04" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
using Microsoft.AspNetCore.Server.Kestrel.Core;
|
||||||
using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF;
|
using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF;
|
||||||
|
using Microsoft.eShopOnContainers.Services.Ordering.API;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure;
|
using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure;
|
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
@ -13,115 +14,111 @@ using System;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.API
|
var configuration = GetConfiguration();
|
||||||
|
|
||||||
|
Log.Logger = CreateSerilogLogger(configuration);
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
public class Program
|
Log.Information("Configuring web host ({ApplicationContext})...", Program.AppName);
|
||||||
|
var host = BuildWebHost(configuration, args);
|
||||||
|
|
||||||
|
Log.Information("Applying migrations ({ApplicationContext})...", Program.AppName);
|
||||||
|
host.MigrateDbContext<OrderingContext>((context, services) =>
|
||||||
{
|
{
|
||||||
public static readonly string Namespace = typeof(Program).Namespace;
|
var env = services.GetService<IWebHostEnvironment>();
|
||||||
public static readonly string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1);
|
var settings = services.GetService<IOptions<OrderingSettings>>();
|
||||||
|
var logger = services.GetService<ILogger<OrderingContextSeed>>();
|
||||||
|
|
||||||
public static int Main(string[] args)
|
new OrderingContextSeed()
|
||||||
|
.SeedAsync(context, env, settings, logger)
|
||||||
|
.Wait();
|
||||||
|
})
|
||||||
|
.MigrateDbContext<IntegrationEventLogContext>((_, __) => { });
|
||||||
|
|
||||||
|
Log.Information("Starting web host ({ApplicationContext})...", Program.AppName);
|
||||||
|
host.Run();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.Fatal(ex, "Program terminated unexpectedly ({ApplicationContext})!", Program.AppName);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
Log.CloseAndFlush();
|
||||||
|
}
|
||||||
|
|
||||||
|
IWebHost BuildWebHost(IConfiguration configuration, string[] args) =>
|
||||||
|
WebHost.CreateDefaultBuilder(args)
|
||||||
|
.CaptureStartupErrors(false)
|
||||||
|
.ConfigureKestrel(options =>
|
||||||
{
|
{
|
||||||
var configuration = GetConfiguration();
|
var ports = GetDefinedPorts(configuration);
|
||||||
|
options.Listen(IPAddress.Any, ports.httpPort, listenOptions =>
|
||||||
Log.Logger = CreateSerilogLogger(configuration);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
Log.Information("Configuring web host ({ApplicationContext})...", AppName);
|
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
|
||||||
var host = BuildWebHost(configuration, args);
|
});
|
||||||
|
|
||||||
Log.Information("Applying migrations ({ApplicationContext})...", AppName);
|
options.Listen(IPAddress.Any, ports.grpcPort, listenOptions =>
|
||||||
host.MigrateDbContext<OrderingContext>((context, services) =>
|
|
||||||
{
|
|
||||||
var env = services.GetService<IWebHostEnvironment>();
|
|
||||||
var settings = services.GetService<IOptions<OrderingSettings>>();
|
|
||||||
var logger = services.GetService<ILogger<OrderingContextSeed>>();
|
|
||||||
|
|
||||||
new OrderingContextSeed()
|
|
||||||
.SeedAsync(context, env, settings, logger)
|
|
||||||
.Wait();
|
|
||||||
})
|
|
||||||
.MigrateDbContext<IntegrationEventLogContext>((_, __) => { });
|
|
||||||
|
|
||||||
Log.Information("Starting web host ({ApplicationContext})...", AppName);
|
|
||||||
host.Run();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
{
|
||||||
Log.Fatal(ex, "Program terminated unexpectedly ({ApplicationContext})!", AppName);
|
listenOptions.Protocols = HttpProtocols.Http2;
|
||||||
return 1;
|
});
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
Log.CloseAndFlush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static IWebHost BuildWebHost(IConfiguration configuration, string[] args) =>
|
})
|
||||||
WebHost.CreateDefaultBuilder(args)
|
.ConfigureAppConfiguration(x => x.AddConfiguration(configuration))
|
||||||
.CaptureStartupErrors(false)
|
.UseStartup<Startup>()
|
||||||
.ConfigureKestrel(options =>
|
.UseContentRoot(Directory.GetCurrentDirectory())
|
||||||
{
|
.UseSerilog()
|
||||||
var ports = GetDefinedPorts(configuration);
|
.Build();
|
||||||
options.Listen(IPAddress.Any, ports.httpPort, listenOptions =>
|
|
||||||
{
|
|
||||||
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
|
|
||||||
});
|
|
||||||
|
|
||||||
options.Listen(IPAddress.Any, ports.grpcPort, listenOptions =>
|
Serilog.ILogger CreateSerilogLogger(IConfiguration configuration)
|
||||||
{
|
{
|
||||||
listenOptions.Protocols = HttpProtocols.Http2;
|
var seqServerUrl = configuration["Serilog:SeqServerUrl"];
|
||||||
});
|
var logstashUrl = configuration["Serilog:LogstashgUrl"];
|
||||||
|
return new LoggerConfiguration()
|
||||||
|
.MinimumLevel.Verbose()
|
||||||
|
.Enrich.WithProperty("ApplicationContext", Program.AppName)
|
||||||
|
.Enrich.FromLogContext()
|
||||||
|
.WriteTo.Console()
|
||||||
|
.WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl)
|
||||||
|
.WriteTo.Http(string.IsNullOrWhiteSpace(logstashUrl) ? "http://logstash:8080" : logstashUrl)
|
||||||
|
.ReadFrom.Configuration(configuration)
|
||||||
|
.CreateLogger();
|
||||||
|
}
|
||||||
|
|
||||||
})
|
IConfiguration GetConfiguration()
|
||||||
.ConfigureAppConfiguration(x => x.AddConfiguration(configuration))
|
{
|
||||||
.UseStartup<Startup>()
|
var builder = new ConfigurationBuilder()
|
||||||
.UseContentRoot(Directory.GetCurrentDirectory())
|
.SetBasePath(Directory.GetCurrentDirectory())
|
||||||
.UseSerilog()
|
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||||
.Build();
|
.AddEnvironmentVariables();
|
||||||
|
|
||||||
private static Serilog.ILogger CreateSerilogLogger(IConfiguration configuration)
|
var config = builder.Build();
|
||||||
{
|
|
||||||
var seqServerUrl = configuration["Serilog:SeqServerUrl"];
|
|
||||||
var logstashUrl = configuration["Serilog:LogstashgUrl"];
|
|
||||||
return new LoggerConfiguration()
|
|
||||||
.MinimumLevel.Verbose()
|
|
||||||
.Enrich.WithProperty("ApplicationContext", AppName)
|
|
||||||
.Enrich.FromLogContext()
|
|
||||||
.WriteTo.Console()
|
|
||||||
.WriteTo.Seq(string.IsNullOrWhiteSpace(seqServerUrl) ? "http://seq" : seqServerUrl)
|
|
||||||
.WriteTo.Http(string.IsNullOrWhiteSpace(logstashUrl) ? "http://logstash:8080" : logstashUrl)
|
|
||||||
.ReadFrom.Configuration(configuration)
|
|
||||||
.CreateLogger();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static IConfiguration GetConfiguration()
|
if (config.GetValue<bool>("UseVault", false))
|
||||||
{
|
{
|
||||||
var builder = new ConfigurationBuilder()
|
builder.AddAzureKeyVault(
|
||||||
.SetBasePath(Directory.GetCurrentDirectory())
|
$"https://{config["Vault:Name"]}.vault.azure.net/",
|
||||||
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
config["Vault:ClientId"],
|
||||||
.AddEnvironmentVariables();
|
config["Vault:ClientSecret"]);
|
||||||
|
|
||||||
var config = builder.Build();
|
|
||||||
|
|
||||||
if (config.GetValue<bool>("UseVault", false))
|
|
||||||
{
|
|
||||||
builder.AddAzureKeyVault(
|
|
||||||
$"https://{config["Vault:Name"]}.vault.azure.net/",
|
|
||||||
config["Vault:ClientId"],
|
|
||||||
config["Vault:ClientSecret"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
return builder.Build();
|
|
||||||
}
|
|
||||||
private static (int httpPort, int grpcPort) GetDefinedPorts(IConfiguration config)
|
|
||||||
{
|
|
||||||
var grpcPort = config.GetValue("GRPC_PORT", 5001);
|
|
||||||
var port = config.GetValue("PORT", 80);
|
|
||||||
return (port, grpcPort);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return builder.Build();
|
||||||
|
}
|
||||||
|
|
||||||
|
(int httpPort, int grpcPort) GetDefinedPorts(IConfiguration config)
|
||||||
|
{
|
||||||
|
var grpcPort = config.GetValue("GRPC_PORT", 5001);
|
||||||
|
var port = config.GetValue("PORT", 80);
|
||||||
|
return (port, grpcPort);
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Program
|
||||||
|
{
|
||||||
|
|
||||||
|
public static string Namespace = typeof(Startup).Namespace;
|
||||||
|
public static string AppName = Namespace.Substring(Namespace.LastIndexOf('.', Namespace.LastIndexOf('.') - 1) + 1);
|
||||||
}
|
}
|
@ -230,8 +230,7 @@
|
|||||||
|
|
||||||
public static IServiceCollection AddCustomDbContext(this IServiceCollection services, IConfiguration configuration)
|
public static IServiceCollection AddCustomDbContext(this IServiceCollection services, IConfiguration configuration)
|
||||||
{
|
{
|
||||||
services.AddEntityFrameworkSqlServer()
|
services.AddDbContext<OrderingContext>(options =>
|
||||||
.AddDbContext<OrderingContext>(options =>
|
|
||||||
{
|
{
|
||||||
options.UseSqlServer(configuration["ConnectionString"],
|
options.UseSqlServer(configuration["ConnectionString"],
|
||||||
sqlServerOptionsAction: sqlOptions =>
|
sqlServerOptionsAction: sqlOptions =>
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
|
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Worker">
|
<Project Sdk="Microsoft.NET.Sdk.Worker">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
<UserSecretsId>dotnet-Ordering.BackgroundTasks-9D3E1DD6-405B-447F-8AAB-1708B36D260E</UserSecretsId>
|
<UserSecretsId>dotnet-Ordering.BackgroundTasks-9D3E1DD6-405B-447F-8AAB-1708B36D260E</UserSecretsId>
|
||||||
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
|
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
|
||||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||||
@ -9,22 +9,23 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.AzureServiceBus" Version="3.0.0" />
|
<PackageReference Include="AspNetCore.HealthChecks.AzureServiceBus" Version="3.2.2" />
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.Rabbitmq" Version="3.0.3" />
|
<PackageReference Include="AspNetCore.HealthChecks.Rabbitmq" Version="3.1.4" />
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="3.0.0" />
|
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="3.2.0" />
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="3.0.0" />
|
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="3.1.2" />
|
||||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="5.0.1" />
|
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
|
||||||
<PackageReference Include="Autofac" Version="4.9.4" />
|
<PackageReference Include="Autofac" Version="6.1.0" />
|
||||||
<PackageReference Include="Dapper" Version="2.0.30" />
|
<PackageReference Include="Dapper" Version="2.0.78" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.1.0" />
|
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.9.5" />
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.8" />
|
||||||
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
|
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
|
||||||
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.1.3" />
|
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.1.3" />
|
||||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.1-dev-00216" />
|
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.1-dev-00216" />
|
||||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0-dev-00834" />
|
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0-dev-00834" />
|
||||||
<PackageReference Include="Serilog.Sinks.Http" Version="5.2.0" />
|
<PackageReference Include="Serilog.Sinks.Http" Version="7.2.0" />
|
||||||
<PackageReference Include="Serilog.Sinks.Seq" Version="4.1.0-dev-00166" />
|
<PackageReference Include="Serilog.Sinks.Seq" Version="4.1.0-dev-00166" />
|
||||||
|
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="7.0.0" />
|
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" />
|
||||||
<PackageReference Include="MediatR" Version="7.0.0" />
|
<PackageReference Include="MediatR" Version="9.0.0" />
|
||||||
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.7.0" />
|
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.7.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
|
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@ -17,10 +17,10 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.1" />
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="3.1.0" />
|
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="5.0.1" />
|
||||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
@ -2,10 +2,11 @@
|
|||||||
"ConnectionString": "Server=tcp:127.0.0.1,5433;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word;",
|
"ConnectionString": "Server=tcp:127.0.0.1,5433;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word;",
|
||||||
"ExternalCatalogBaseUrl": "http://localhost:5101",
|
"ExternalCatalogBaseUrl": "http://localhost:5101",
|
||||||
"IdentityUrl": "http://localhost:5105",
|
"IdentityUrl": "http://localhost:5105",
|
||||||
|
"IdentityUrlExternal": "http://localhost:5105",
|
||||||
"isTest": "true",
|
"isTest": "true",
|
||||||
"EventBusConnection": "localhost",
|
"EventBusConnection": "localhost",
|
||||||
"CheckUpdateTime": "30000",
|
"CheckUpdateTime": "30000",
|
||||||
"GracePeriodTime": "1",
|
"GracePeriodTime": "1",
|
||||||
"SubscriptionClientName": "Ordering",
|
"SubscriptionClientName": "Ordering",
|
||||||
"SuppressCheckForUnhandledSecurityMetadata":true
|
"SuppressCheckForUnhandledSecurityMetadata": true
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,10 @@ namespace Ordering.Infrastructure.EntityConfigurations
|
|||||||
orderConfiguration
|
orderConfiguration
|
||||||
.OwnsOne(o => o.Address, a =>
|
.OwnsOne(o => o.Address, a =>
|
||||||
{
|
{
|
||||||
|
// Explicit configuration of the shadow key property in the owned type
|
||||||
|
// as a workaround for a documented issue in EF Core 5: https://github.com/dotnet/efcore/issues/20740
|
||||||
|
a.Property<int>("OrderId")
|
||||||
|
.UseHiLo("orderseq", OrderingContext.DEFAULT_SCHEMA);
|
||||||
a.WithOwner();
|
a.WithOwner();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -9,9 +9,11 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.0" />
|
<PackageReference Include="MediatR" Version="9.0.0" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.0" />
|
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="9.0.0" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.0" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.1" />
|
||||||
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.1" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -147,6 +147,10 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Infrastructure
|
|||||||
return Task.FromResult<TResponse>(default(TResponse));
|
return Task.FromResult<TResponse>(default(TResponse));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task<object> Send(object request, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
return Task.FromResult(default(object));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
|
FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS base
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||||
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
|
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
|
||||||
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
|
<IsTransformWebConfigDisabled>true</IsTransformWebConfigDisabled>
|
||||||
@ -13,25 +13,25 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.AzureServiceBus" Version="3.0.0" />
|
<PackageReference Include="AspNetCore.HealthChecks.AzureServiceBus" Version="3.2.2" />
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.Rabbitmq" Version="3.0.3" />
|
<PackageReference Include="AspNetCore.HealthChecks.Rabbitmq" Version="3.1.4" />
|
||||||
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="3.0.0" />
|
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="3.1.2" />
|
||||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="5.0.1" />
|
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
|
||||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.12.0" />
|
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.16.0" />
|
||||||
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.12.0" />
|
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.16.0" />
|
||||||
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.1.1" />
|
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.1.3" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="3.1.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="3.0.0-preview4-19123-01" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication" Version="3.0.0-preview4-19123-01" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="3.1.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="3.1.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0" />
|
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.HealthChecks" Version="1.0.0" />
|
<PackageReference Include="Microsoft.AspNetCore.HealthChecks" Version="1.0.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.SignalR.Redis" Version="3.0.0-alpha1-34847" />
|
<PackageReference Include="Microsoft.AspNetCore.SignalR.Redis" Version="3.0.0-alpha1-34847" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="3.1.0" />
|
<PackageReference Include="Microsoft.Extensions.Logging.AzureAppServices" Version="5.0.1" />
|
||||||
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
|
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
|
||||||
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.1.3" />
|
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.1.3" />
|
||||||
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.1-dev-00216" />
|
<PackageReference Include="Serilog.Settings.Configuration" Version="3.1.1-dev-00216" />
|
||||||
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0-dev-00834" />
|
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0-dev-00834" />
|
||||||
<PackageReference Include="Serilog.Sinks.Http" Version="5.2.0" />
|
<PackageReference Include="Serilog.Sinks.Http" Version="7.2.0" />
|
||||||
<PackageReference Include="Serilog.Sinks.Seq" Version="4.1.0-dev-00166" />
|
<PackageReference Include="Serilog.Sinks.Seq" Version="4.1.0-dev-00166" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>net5.0</TargetFramework>
|
||||||
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
|
<GenerateErrorForMissingTargetingPacks>false</GenerateErrorForMissingTargetingPacks>
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="MediatR" Version="7.0.0" />
|
<PackageReference Include="MediatR" Version="9.0.0" />
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
|
||||||
<PackageReference Include="Microsoft.NETCore.Platforms" Version="3.1.0" />
|
<PackageReference Include="Microsoft.NETCore.Platforms" Version="5.0.0" />
|
||||||
<PackageReference Include="Moq" Version="4.13.1" />
|
<PackageReference Include="Moq" Version="4.15.2" />
|
||||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user