Newtonsoft.Json and MediatR with fixes of all based on MediatR classes
also from csproj files excluded direct specification of runtime to make compile happy if on a system we have higher version.
This commit is contained in:
parent
85b61a2bfd
commit
9e75504690
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
<TargetFramework>netcoreapp1.1</TargetFramework>
|
||||||
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
|
|
||||||
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.EventBus</RootNamespace>
|
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.EventBus</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
@ -11,7 +10,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
@ -2,14 +2,13 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
<TargetFramework>netcoreapp1.1</TargetFramework>
|
||||||
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
|
|
||||||
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ</RootNamespace>
|
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.2" />
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.2" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
|
||||||
<PackageReference Include="Polly" Version="5.0.6" />
|
<PackageReference Include="Polly" Version="5.1.0" />
|
||||||
<PackageReference Include="RabbitMQ.Client" Version="4.1.3" />
|
<PackageReference Include="RabbitMQ.Client" Version="4.1.3" />
|
||||||
<PackageReference Include="System.ValueTuple" Version="4.3.1" />
|
<PackageReference Include="System.ValueTuple" Version="4.3.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
<TargetFramework>netcoreapp1.1</TargetFramework>
|
||||||
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
|
|
||||||
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF</RootNamespace>
|
<RootNamespace>Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF</RootNamespace>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
@ -13,7 +12,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.2" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.2" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.2" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.2" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.1" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.2" />
|
<PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.2" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
|
||||||
<PackageReference Include="System.Diagnostics.Process" Version="4.3.0" />
|
<PackageReference Include="System.Diagnostics.Process" Version="4.3.0" />
|
||||||
<PackageReference Include="System.Threading.Tasks.Parallel" Version="4.3.0" />
|
<PackageReference Include="System.Threading.Tasks.Parallel" Version="4.3.0" />
|
||||||
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />
|
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />
|
||||||
|
@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="1.1.2" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="1.1.2" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
|
||||||
<PackageReference Include="Polly" Version="5.0.6" />
|
<PackageReference Include="Polly" Version="5.1.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
@ -2,12 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
<TargetFramework>netcoreapp1.1</TargetFramework>
|
||||||
<DebugType>portable</DebugType>
|
|
||||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
|
||||||
<AssemblyName>Basket.API</AssemblyName>
|
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<PackageId>Basket.API</PackageId>
|
|
||||||
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
|
|
||||||
<PackageTargetFallback>$(PackageTargetFallback);netstandard1.6.1;dnxcore50;portable-net451+win8</PackageTargetFallback>
|
<PackageTargetFallback>$(PackageTargetFallback);netstandard1.6.1;dnxcore50;portable-net451+win8</PackageTargetFallback>
|
||||||
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@ -35,7 +30,7 @@
|
|||||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.2" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.1.2" />
|
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.1.2" />
|
||||||
<PackageReference Include="StackExchange.Redis" Version="1.2.3" />
|
<PackageReference Include="StackExchange.Redis" Version="1.2.3" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
|
||||||
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="1.2.0" />
|
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="1.2.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@ -2,13 +2,8 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
<TargetFramework>netcoreapp1.1</TargetFramework>
|
||||||
<DebugType>portable</DebugType>
|
|
||||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
|
||||||
<AssemblyName>Catalog.API</AssemblyName>
|
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<PackageId>Catalog.API</PackageId>
|
|
||||||
<UserSecretsId>aspnet-Catalog.API-20161122013618</UserSecretsId>
|
<UserSecretsId>aspnet-Catalog.API-20161122013618</UserSecretsId>
|
||||||
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
|
|
||||||
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
|
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
|
||||||
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@ -47,7 +42,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="1.1.2" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="1.1.2" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.2" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.2" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.2" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.2" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@ -2,13 +2,8 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
<TargetFramework>netcoreapp1.1</TargetFramework>
|
||||||
<DebugType>portable</DebugType>
|
|
||||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
|
||||||
<AssemblyName>Identity.API</AssemblyName>
|
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<PackageId>Identity.API</PackageId>
|
|
||||||
<UserSecretsId>aspnet-eShopOnContainers.Identity-90487118-103c-4ff0-b9da-e5e26f7ab0c5</UserSecretsId>
|
<UserSecretsId>aspnet-eShopOnContainers.Identity-90487118-103c-4ff0-b9da-e5e26f7ab0c5</UserSecretsId>
|
||||||
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
|
|
||||||
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
|
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
|
||||||
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@ -17,7 +17,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
|
|||||||
|
|
||||||
[DataContract]
|
[DataContract]
|
||||||
public class CreateOrderCommand
|
public class CreateOrderCommand
|
||||||
:IAsyncRequest<bool>
|
: IRequest<bool>
|
||||||
{
|
{
|
||||||
[DataMember]
|
[DataMember]
|
||||||
private readonly List<OrderItemDTO> _orderItems;
|
private readonly List<OrderItemDTO> _orderItems;
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
using MediatR;
|
using MediatR;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
|
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
|
||||||
{
|
{
|
||||||
public class IdentifiedCommand<T, R> : IAsyncRequest<R>
|
public class IdentifiedCommand<T, R> : IRequest<R>
|
||||||
where T : IAsyncRequest<R>
|
where T : IRequest<R>
|
||||||
{
|
{
|
||||||
public T Command { get; }
|
public T Command { get; }
|
||||||
public Guid Id { get; }
|
public Guid Id { get; }
|
||||||
|
@ -11,7 +11,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
|
|||||||
/// <typeparam name="T">Type of the command handler that performs the operation if request is not duplicated</typeparam>
|
/// <typeparam name="T">Type of the command handler that performs the operation if request is not duplicated</typeparam>
|
||||||
/// <typeparam name="R">Return value of the inner command handler</typeparam>
|
/// <typeparam name="R">Return value of the inner command handler</typeparam>
|
||||||
public class IdentifierCommandHandler<T, R> : IAsyncRequestHandler<IdentifiedCommand<T, R>, R>
|
public class IdentifierCommandHandler<T, R> : IAsyncRequestHandler<IdentifiedCommand<T, R>, R>
|
||||||
where T : IAsyncRequest<R>
|
where T : IRequest<R>
|
||||||
{
|
{
|
||||||
private readonly IMediator _mediator;
|
private readonly IMediator _mediator;
|
||||||
private readonly IRequestManager _requestManager;
|
private readonly IRequestManager _requestManager;
|
||||||
@ -48,7 +48,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
|
|||||||
{
|
{
|
||||||
await _requestManager.CreateRequestForCommandAsync<T>(message.Id);
|
await _requestManager.CreateRequestForCommandAsync<T>(message.Id);
|
||||||
|
|
||||||
var result = await _mediator.SendAsync(message.Command);
|
var result = await _mediator.Send(message.Command);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
public class LogDecorator<TRequest, TResponse>
|
public class LogDecorator<TRequest, TResponse>
|
||||||
: IAsyncRequestHandler<TRequest, TResponse>
|
: IAsyncRequestHandler<TRequest, TResponse>
|
||||||
where TRequest : IAsyncRequest<TResponse>
|
where TRequest : IRequest<TResponse>
|
||||||
{
|
{
|
||||||
private readonly IAsyncRequestHandler<TRequest, TResponse> _inner;
|
private readonly IAsyncRequestHandler<TRequest, TResponse> _inner;
|
||||||
private readonly ILogger<LogDecorator<TRequest, TResponse>> _logger;
|
private readonly ILogger<LogDecorator<TRequest, TResponse>> _logger;
|
||||||
|
@ -10,7 +10,7 @@ namespace Ordering.API.Application.Decorators
|
|||||||
{
|
{
|
||||||
public class ValidatorDecorator<TRequest, TResponse>
|
public class ValidatorDecorator<TRequest, TResponse>
|
||||||
: IAsyncRequestHandler<TRequest, TResponse>
|
: IAsyncRequestHandler<TRequest, TResponse>
|
||||||
where TRequest : IAsyncRequest<TResponse>
|
where TRequest : IRequest<TResponse>
|
||||||
{
|
{
|
||||||
private readonly IAsyncRequestHandler<TRequest, TResponse> _inner;
|
private readonly IAsyncRequestHandler<TRequest, TResponse> _inner;
|
||||||
private readonly IValidator<TRequest>[] _validators;
|
private readonly IValidator<TRequest>[] _validators;
|
||||||
|
@ -34,13 +34,13 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers
|
|||||||
if (Guid.TryParse(requestId, out Guid guid) && guid != Guid.Empty)
|
if (Guid.TryParse(requestId, out Guid guid) && guid != Guid.Empty)
|
||||||
{
|
{
|
||||||
var requestCreateOrder = new IdentifiedCommand<CreateOrderCommand, bool>(command, guid);
|
var requestCreateOrder = new IdentifiedCommand<CreateOrderCommand, bool>(command, guid);
|
||||||
commandResult = await _mediator.SendAsync(requestCreateOrder);
|
commandResult = await _mediator.Send(requestCreateOrder);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// If no x-requestid header is found we process the order anyway. This is just temporary to not break existing clients
|
// If no x-requestid header is found we process the order anyway. This is just temporary to not break existing clients
|
||||||
// that aren't still updated. When all clients were updated this could be removed.
|
// that aren't still updated. When all clients were updated this could be removed.
|
||||||
commandResult = await _mediator.SendAsync(command);
|
commandResult = await _mediator.Send(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
return commandResult ? (IActionResult)Ok() : (IActionResult)BadRequest();
|
return commandResult ? (IActionResult)Ok() : (IActionResult)BadRequest();
|
||||||
|
@ -2,13 +2,8 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
<TargetFramework>netcoreapp1.1</TargetFramework>
|
||||||
<DebugType>portable</DebugType>
|
|
||||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
|
||||||
<AssemblyName>Ordering.API</AssemblyName>
|
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<PackageId>Ordering.API</PackageId>
|
|
||||||
<UserSecretsId>aspnet-Ordering.API-20161122013547</UserSecretsId>
|
<UserSecretsId>aspnet-Ordering.API-20161122013547</UserSecretsId>
|
||||||
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
|
|
||||||
<PackageTargetFallback>$(PackageTargetFallback);netstandard1.6.1;dnxcore50;portable-net451+win8</PackageTargetFallback>
|
<PackageTargetFallback>$(PackageTargetFallback);netstandard1.6.1;dnxcore50;portable-net451+win8</PackageTargetFallback>
|
||||||
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
<DockerComposeProjectPath>..\..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@ -36,7 +31,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="FluentValidation.AspNetCore" Version="6.4.0" />
|
<PackageReference Include="FluentValidation.AspNetCore" Version="6.4.0" />
|
||||||
<PackageReference Include="FluentValidation.MVC6" Version="6.4.0" />
|
<PackageReference Include="FluentValidation.MVC6" Version="6.4.0" />
|
||||||
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="1.1.0" />
|
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="2.0.0" />
|
||||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.1.0" />
|
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.1.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.3" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.2" />
|
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.2" />
|
||||||
@ -56,7 +51,7 @@
|
|||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.2" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="1.1.2" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.2" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.2" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.1.2" />
|
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.1.2" />
|
||||||
<PackageReference Include="MediatR" Version="2.1.0" />
|
<PackageReference Include="MediatR" Version="3.0.1" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.0.0" />
|
||||||
<PackageReference Include="System.Reflection" Version="4.3.0" />
|
<PackageReference Include="System.Reflection" Version="4.3.0" />
|
||||||
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="1.2.0" />
|
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="1.2.0" />
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.BuyerAggregate;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace Ordering.Domain.Events
|
namespace Ordering.Domain.Events
|
||||||
{
|
{
|
||||||
public class BuyerAndPaymentMethodVerifiedDomainEvent
|
public class BuyerAndPaymentMethodVerifiedDomainEvent
|
||||||
: IAsyncNotification
|
: INotification
|
||||||
{
|
{
|
||||||
public Buyer Buyer { get; private set; }
|
public Buyer Buyer { get; private set; }
|
||||||
public PaymentMethod Payment { get; private set; }
|
public PaymentMethod Payment { get; private set; }
|
||||||
|
@ -10,7 +10,7 @@ namespace Ordering.Domain.Events
|
|||||||
/// Event used when an order is created
|
/// Event used when an order is created
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class OrderStartedDomainEvent
|
public class OrderStartedDomainEvent
|
||||||
: IAsyncNotification
|
: INotification
|
||||||
{
|
{
|
||||||
public int CardTypeId { get; private set; }
|
public int CardTypeId { get; private set; }
|
||||||
public string CardNumber { get; private set; }
|
public string CardNumber { get; private set; }
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="MediatR" Version="2.1.0" />
|
<PackageReference Include="MediatR" Version="3.0.1" />
|
||||||
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="1.1.0" />
|
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="2.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
int? _requestedHashCode;
|
int? _requestedHashCode;
|
||||||
int _Id;
|
int _Id;
|
||||||
|
|
||||||
private List<IAsyncNotification> _domainEvents;
|
private List<INotification> _domainEvents;
|
||||||
|
|
||||||
public virtual int Id
|
public virtual int Id
|
||||||
{
|
{
|
||||||
@ -24,14 +24,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<IAsyncNotification> DomainEvents => _domainEvents;
|
public List<INotification> DomainEvents => _domainEvents;
|
||||||
public void AddDomainEvent(IAsyncNotification eventItem)
|
public void AddDomainEvent(INotification eventItem)
|
||||||
{
|
{
|
||||||
_domainEvents = _domainEvents ?? new List<IAsyncNotification>();
|
_domainEvents = _domainEvents ?? new List<INotification>();
|
||||||
_domainEvents.Add(eventItem);
|
_domainEvents.Add(eventItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveDomainEvent(IAsyncNotification eventItem)
|
public void RemoveDomainEvent(INotification eventItem)
|
||||||
{
|
{
|
||||||
if (_domainEvents is null) return;
|
if (_domainEvents is null) return;
|
||||||
_domainEvents.Remove(eventItem);
|
_domainEvents.Remove(eventItem);
|
||||||
|
@ -23,7 +23,7 @@ namespace Ordering.Infrastructure
|
|||||||
|
|
||||||
var tasks = domainEvents
|
var tasks = domainEvents
|
||||||
.Select(async (domainEvent) => {
|
.Select(async (domainEvent) => {
|
||||||
await mediator.PublishAsync(domainEvent);
|
await mediator.Publish(domainEvent);
|
||||||
});
|
});
|
||||||
|
|
||||||
await Task.WhenAll(tasks);
|
await Task.WhenAll(tasks);
|
||||||
|
@ -2,13 +2,8 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
<TargetFramework>netcoreapp1.1</TargetFramework>
|
||||||
<DebugType>portable</DebugType>
|
|
||||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
|
||||||
<AssemblyName>WebMVC</AssemblyName>
|
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<PackageId>WebMVC</PackageId>
|
|
||||||
<UserSecretsId>aspnet-Microsoft.eShopOnContainers-946ae052-8305-4a99-965b-ec8636ddbae3</UserSecretsId>
|
<UserSecretsId>aspnet-Microsoft.eShopOnContainers-946ae052-8305-4a99-965b-ec8636ddbae3</UserSecretsId>
|
||||||
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
|
|
||||||
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
|
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
|
||||||
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
@ -38,7 +33,7 @@
|
|||||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="1.1.1">
|
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="1.1.1">
|
||||||
<PrivateAssets>All</PrivateAssets>
|
<PrivateAssets>All</PrivateAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
|
||||||
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.1.3" />
|
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.1.3" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="1.1.2" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="1.1.2" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="1.1.2" />
|
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="1.1.2" />
|
||||||
|
@ -2,13 +2,9 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
<TargetFramework>netcoreapp1.1</TargetFramework>
|
||||||
<DebugType>portable</DebugType>
|
|
||||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
|
||||||
<AssemblyName>WebSPA</AssemblyName>
|
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<PackageId>eShopOnContainers.WebSPA</PackageId>
|
<PackageId>eShopOnContainers.WebSPA</PackageId>
|
||||||
<UserSecretsId>aspnetcorespa-c23d27a4-eb88-4b18-9b77-2a93f3b15119</UserSecretsId>
|
<UserSecretsId>aspnetcorespa-c23d27a4-eb88-4b18-9b77-2a93f3b15119</UserSecretsId>
|
||||||
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
|
|
||||||
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
|
<PackageTargetFallback>$(PackageTargetFallback);dotnet5.6;portable-net45+win8</PackageTargetFallback>
|
||||||
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||||
<TypeScriptCompileOnSaveEnabled>false</TypeScriptCompileOnSaveEnabled>
|
<TypeScriptCompileOnSaveEnabled>false</TypeScriptCompileOnSaveEnabled>
|
||||||
@ -38,7 +34,7 @@
|
|||||||
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="1.1.2" />
|
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="1.1.2" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Antiforgery" Version="1.1.2" />
|
<PackageReference Include="Microsoft.AspNetCore.Antiforgery" Version="1.1.2" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="1.1.2" />
|
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="1.1.2" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
|
<PackageReference Include="Newtonsoft.Json" Version="10.0.2" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.AngularServices" Version="1.0.0-beta-000014" />
|
<PackageReference Include="Microsoft.AspNetCore.AngularServices" Version="1.0.0-beta-000014" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.2" />
|
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.2" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.2" />
|
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.2" />
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
|
|
||||||
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
|
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
|
||||||
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
<TargetFramework>netcoreapp1.1</TargetFramework>
|
||||||
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
<AssemblyName>IntegrationTests</AssemblyName>
|
<AssemblyName>IntegrationTests</AssemblyName>
|
||||||
<PackageId>FunctionalTests</PackageId>
|
<PackageId>FunctionalTests</PackageId>
|
||||||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
|
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
|
||||||
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
|
|
||||||
<PackageTargetFallback>$(PackageTargetFallback);netstandard1.6.1;dnxcore50;portable-net451+win8</PackageTargetFallback>
|
<PackageTargetFallback>$(PackageTargetFallback);netstandard1.6.1;dnxcore50;portable-net451+win8</PackageTargetFallback>
|
||||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
|
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
|
||||||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
|
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
|
||||||
|
@ -33,7 +33,7 @@ namespace UnitTest.Ordering.Application
|
|||||||
_requestManager.Setup(x => x.ExistAsync(It.IsAny<Guid>()))
|
_requestManager.Setup(x => x.ExistAsync(It.IsAny<Guid>()))
|
||||||
.Returns(Task.FromResult(false));
|
.Returns(Task.FromResult(false));
|
||||||
|
|
||||||
_mediator.Setup(x => x.SendAsync(It.IsAny<IAsyncRequest<bool>>()))
|
_mediator.Setup(x => x.Send(It.IsAny<IRequest<bool>>(),default(System.Threading.CancellationToken)))
|
||||||
.Returns(Task.FromResult(true));
|
.Returns(Task.FromResult(true));
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
@ -42,7 +42,7 @@ namespace UnitTest.Ordering.Application
|
|||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
Assert.True(result);
|
Assert.True(result);
|
||||||
_mediator.Verify(x => x.SendAsync(It.IsAny<IAsyncRequest<bool>>()), Times.Once());
|
_mediator.Verify(x => x.Send(It.IsAny<IRequest<bool>>(), default(System.Threading.CancellationToken)), Times.Once());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@ -55,7 +55,7 @@ namespace UnitTest.Ordering.Application
|
|||||||
_requestManager.Setup(x => x.ExistAsync(It.IsAny<Guid>()))
|
_requestManager.Setup(x => x.ExistAsync(It.IsAny<Guid>()))
|
||||||
.Returns(Task.FromResult(true));
|
.Returns(Task.FromResult(true));
|
||||||
|
|
||||||
_mediator.Setup(x => x.SendAsync(It.IsAny<IAsyncRequest<bool>>()))
|
_mediator.Setup(x => x.Send(It.IsAny<IRequest<bool>>(), default(System.Threading.CancellationToken)))
|
||||||
.Returns(Task.FromResult(true));
|
.Returns(Task.FromResult(true));
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
@ -64,7 +64,7 @@ namespace UnitTest.Ordering.Application
|
|||||||
|
|
||||||
//Assert
|
//Assert
|
||||||
Assert.False(result);
|
Assert.False(result);
|
||||||
_mediator.Verify(x => x.SendAsync(It.IsAny<IAsyncRequest<bool>>()), Times.Never());
|
_mediator.Verify(x => x.Send(It.IsAny<IRequest<bool>>(), default(System.Threading.CancellationToken)), Times.Never());
|
||||||
}
|
}
|
||||||
|
|
||||||
private CreateOrderCommand FakeOrderRequest(Dictionary<string, object> args = null)
|
private CreateOrderCommand FakeOrderRequest(Dictionary<string, object> args = null)
|
||||||
|
@ -29,7 +29,7 @@ namespace UnitTest.Ordering.Application
|
|||||||
public async Task Create_order_with_requestId_success()
|
public async Task Create_order_with_requestId_success()
|
||||||
{
|
{
|
||||||
//Arrange
|
//Arrange
|
||||||
_mediatorMock.Setup(x => x.SendAsync(It.IsAny<IdentifiedCommand<CreateOrderCommand, bool>>()))
|
_mediatorMock.Setup(x => x.Send(It.IsAny<IdentifiedCommand<CreateOrderCommand, bool>>(), default(System.Threading.CancellationToken)))
|
||||||
.Returns(Task.FromResult(true));
|
.Returns(Task.FromResult(true));
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
@ -45,7 +45,7 @@ namespace UnitTest.Ordering.Application
|
|||||||
public async Task Create_order_bad_request()
|
public async Task Create_order_bad_request()
|
||||||
{
|
{
|
||||||
//Arrange
|
//Arrange
|
||||||
_mediatorMock.Setup(x => x.SendAsync(It.IsAny<IdentifiedCommand<CreateOrderCommand, bool>>()))
|
_mediatorMock.Setup(x => x.Send(It.IsAny<IdentifiedCommand<CreateOrderCommand, bool>>(), default(System.Threading.CancellationToken)))
|
||||||
.Returns(Task.FromResult(true));
|
.Returns(Task.FromResult(true));
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
|
@ -2,10 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp1.1</TargetFramework>
|
<TargetFramework>netcoreapp1.1</TargetFramework>
|
||||||
<AssemblyName>UnitTest</AssemblyName>
|
|
||||||
<PackageId>UnitTest</PackageId>
|
|
||||||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
|
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
|
||||||
<RuntimeFrameworkVersion>1.1.0</RuntimeFrameworkVersion>
|
|
||||||
<PackageTargetFallback>$(PackageTargetFallback);netstandard1.6.1;dnxcore50;portable-net451+win8</PackageTargetFallback>
|
<PackageTargetFallback>$(PackageTargetFallback);netstandard1.6.1;dnxcore50;portable-net451+win8</PackageTargetFallback>
|
||||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
|
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
|
||||||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
|
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
|
||||||
@ -25,7 +22,7 @@
|
|||||||
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />
|
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
|
||||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
|
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
|
||||||
<PackageReference Include="MediatR" Version="2.1.0" />
|
<PackageReference Include="MediatR" Version="3.0.1" />
|
||||||
<PackageReference Include="Moq" Version="4.7.10" />
|
<PackageReference Include="Moq" Version="4.7.10" />
|
||||||
<PackageReference Include="xunit" Version="2.2.0" />
|
<PackageReference Include="xunit" Version="2.2.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="1.1.2" />
|
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="1.1.2" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user