commit
29996fc94d
@ -1,8 +1,6 @@
|
|||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using System;
|
using System.Threading;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ordering.API.Infrastructure.Behaviors
|
namespace Ordering.API.Infrastructure.Behaviors
|
||||||
@ -12,7 +10,7 @@ namespace Ordering.API.Infrastructure.Behaviors
|
|||||||
private readonly ILogger<LoggingBehavior<TRequest, TResponse>> _logger;
|
private readonly ILogger<LoggingBehavior<TRequest, TResponse>> _logger;
|
||||||
public LoggingBehavior(ILogger<LoggingBehavior<TRequest, TResponse>> logger) => _logger = logger;
|
public LoggingBehavior(ILogger<LoggingBehavior<TRequest, TResponse>> logger) => _logger = logger;
|
||||||
|
|
||||||
public async Task<TResponse> Handle(TRequest request, RequestHandlerDelegate<TResponse> next)
|
public async Task<TResponse> Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate<TResponse> next)
|
||||||
{
|
{
|
||||||
_logger.LogInformation($"Handling {typeof(TRequest).Name}");
|
_logger.LogInformation($"Handling {typeof(TRequest).Name}");
|
||||||
var response = await next();
|
var response = await next();
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Ordering.Domain.Exceptions;
|
using Ordering.Domain.Exceptions;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ordering.API.Infrastructure.Behaviors
|
namespace Ordering.API.Infrastructure.Behaviors
|
||||||
@ -14,7 +13,7 @@ namespace Ordering.API.Infrastructure.Behaviors
|
|||||||
private readonly IValidator<TRequest>[] _validators;
|
private readonly IValidator<TRequest>[] _validators;
|
||||||
public ValidatorBehavior(IValidator<TRequest>[] validators) => _validators = validators;
|
public ValidatorBehavior(IValidator<TRequest>[] validators) => _validators = validators;
|
||||||
|
|
||||||
public async Task<TResponse> Handle(TRequest request, RequestHandlerDelegate<TResponse> next)
|
public async Task<TResponse> Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate<TResponse> next)
|
||||||
{
|
{
|
||||||
var failures = _validators
|
var failures = _validators
|
||||||
.Select(v => v.Validate(request))
|
.Select(v => v.Validate(request))
|
||||||
|
@ -2,15 +2,13 @@
|
|||||||
using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands;
|
using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency;
|
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency;
|
||||||
using System;
|
using System.Threading;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ordering.API.Application.Commands
|
namespace Ordering.API.Application.Commands
|
||||||
{
|
{
|
||||||
// Regular CommandHandler
|
// Regular CommandHandler
|
||||||
public class CancelOrderCommandHandler : IAsyncRequestHandler<CancelOrderCommand, bool>
|
public class CancelOrderCommandHandler : IRequestHandler<CancelOrderCommand, bool>
|
||||||
{
|
{
|
||||||
private readonly IOrderRepository _orderRepository;
|
private readonly IOrderRepository _orderRepository;
|
||||||
|
|
||||||
@ -25,7 +23,7 @@ namespace Ordering.API.Application.Commands
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="command"></param>
|
/// <param name="command"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<bool> Handle(CancelOrderCommand command)
|
public async Task<bool> Handle(CancelOrderCommand command, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var orderToUpdate = await _orderRepository.GetAsync(command.OrderNumber);
|
var orderToUpdate = await _orderRepository.GetAsync(command.OrderNumber);
|
||||||
if(orderToUpdate == null)
|
if(orderToUpdate == null)
|
||||||
|
@ -5,11 +5,12 @@
|
|||||||
using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Services;
|
using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Services;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency;
|
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
// Regular CommandHandler
|
// Regular CommandHandler
|
||||||
public class CreateOrderCommandHandler
|
public class CreateOrderCommandHandler
|
||||||
: IAsyncRequestHandler<CreateOrderCommand, bool>
|
: IRequestHandler<CreateOrderCommand, bool>
|
||||||
{
|
{
|
||||||
private readonly IOrderRepository _orderRepository;
|
private readonly IOrderRepository _orderRepository;
|
||||||
private readonly IIdentityService _identityService;
|
private readonly IIdentityService _identityService;
|
||||||
@ -23,7 +24,7 @@
|
|||||||
_mediator = mediator ?? throw new ArgumentNullException(nameof(mediator));
|
_mediator = mediator ?? throw new ArgumentNullException(nameof(mediator));
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<bool> Handle(CreateOrderCommand message)
|
public async Task<bool> Handle(CreateOrderCommand message, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
// Add/Update the Buyer AggregateRoot
|
// Add/Update the Buyer AggregateRoot
|
||||||
// DDD patterns comment: Add child entities and value-objects through the Order Aggregate-Root
|
// DDD patterns comment: Add child entities and value-objects through the Order Aggregate-Root
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency;
|
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
|
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
|
||||||
@ -10,7 +11,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <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 IdentifiedCommandHandler<T, R> : IAsyncRequestHandler<IdentifiedCommand<T, R>, R>
|
public class IdentifiedCommandHandler<T, R> : IRequestHandler<IdentifiedCommand<T, R>, R>
|
||||||
where T : IRequest<R>
|
where T : IRequest<R>
|
||||||
{
|
{
|
||||||
private readonly IMediator _mediator;
|
private readonly IMediator _mediator;
|
||||||
@ -37,7 +38,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message">IdentifiedCommand which contains both original command & request ID</param>
|
/// <param name="message">IdentifiedCommand which contains both original command & request ID</param>
|
||||||
/// <returns>Return value of inner command or default value if request same ID was found</returns>
|
/// <returns>Return value of inner command or default value if request same ID was found</returns>
|
||||||
public async Task<R> Handle(IdentifiedCommand<T, R> message)
|
public async Task<R> Handle(IdentifiedCommand<T, R> message, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var alreadyExists = await _requestManager.ExistAsync(message.Id);
|
var alreadyExists = await _requestManager.ExistAsync(message.Id);
|
||||||
if (alreadyExists)
|
if (alreadyExists)
|
||||||
@ -55,6 +56,4 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -2,12 +2,13 @@
|
|||||||
using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands;
|
using Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency;
|
using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure.Idempotency;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ordering.API.Application.Commands
|
namespace Ordering.API.Application.Commands
|
||||||
{
|
{
|
||||||
// Regular CommandHandler
|
// Regular CommandHandler
|
||||||
public class ShipOrderCommandHandler : IAsyncRequestHandler<ShipOrderCommand, bool>
|
public class ShipOrderCommandHandler : IRequestHandler<ShipOrderCommand, bool>
|
||||||
{
|
{
|
||||||
private readonly IOrderRepository _orderRepository;
|
private readonly IOrderRepository _orderRepository;
|
||||||
|
|
||||||
@ -22,7 +23,7 @@ namespace Ordering.API.Application.Commands
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="command"></param>
|
/// <param name="command"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<bool> Handle(ShipOrderCommand command)
|
public async Task<bool> Handle(ShipOrderCommand command, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var orderToUpdate = await _orderRepository.GetAsync(command.OrderNumber);
|
var orderToUpdate = await _orderRepository.GetAsync(command.OrderNumber);
|
||||||
if(orderToUpdate == null)
|
if(orderToUpdate == null)
|
||||||
|
@ -1,16 +1,15 @@
|
|||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Ordering.API.Application.IntegrationEvents;
|
|
||||||
using Ordering.API.Application.IntegrationEvents.Events;
|
|
||||||
using Ordering.Domain.Events;
|
using Ordering.Domain.Events;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ordering.API.Application.DomainEventHandlers.BuyerAndPaymentMethodVerified
|
namespace Ordering.API.Application.DomainEventHandlers.BuyerAndPaymentMethodVerified
|
||||||
{
|
{
|
||||||
public class UpdateOrderWhenBuyerAndPaymentMethodVerifiedDomainEventHandler
|
public class UpdateOrderWhenBuyerAndPaymentMethodVerifiedDomainEventHandler
|
||||||
: IAsyncNotificationHandler<BuyerAndPaymentMethodVerifiedDomainEvent>
|
: INotificationHandler<BuyerAndPaymentMethodVerifiedDomainEvent>
|
||||||
{
|
{
|
||||||
private readonly IOrderRepository _orderRepository;
|
private readonly IOrderRepository _orderRepository;
|
||||||
private readonly ILoggerFactory _logger;
|
private readonly ILoggerFactory _logger;
|
||||||
@ -25,7 +24,7 @@ namespace Ordering.API.Application.DomainEventHandlers.BuyerAndPaymentMethodVeri
|
|||||||
// Domain Logic comment:
|
// Domain Logic comment:
|
||||||
// When the Buyer and Buyer's payment method have been created or verified that they existed,
|
// When the Buyer and Buyer's payment method have been created or verified that they existed,
|
||||||
// then we can update the original Order with the BuyerId and PaymentId (foreign keys)
|
// then we can update the original Order with the BuyerId and PaymentId (foreign keys)
|
||||||
public async Task Handle(BuyerAndPaymentMethodVerifiedDomainEvent buyerPaymentMethodVerifiedEvent)
|
public async Task Handle(BuyerAndPaymentMethodVerifiedDomainEvent buyerPaymentMethodVerifiedEvent, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var orderToUpdate = await _orderRepository.GetAsync(buyerPaymentMethodVerifiedEvent.OrderId);
|
var orderToUpdate = await _orderRepository.GetAsync(buyerPaymentMethodVerifiedEvent.OrderId);
|
||||||
orderToUpdate.SetBuyerId(buyerPaymentMethodVerifiedEvent.Buyer.Id);
|
orderToUpdate.SetBuyerId(buyerPaymentMethodVerifiedEvent.Buyer.Id);
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
using Ordering.API.Application.IntegrationEvents;
|
using Ordering.API.Application.IntegrationEvents;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Ordering.API.Application.IntegrationEvents.Events;
|
using Ordering.API.Application.IntegrationEvents.Events;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
public class OrderStatusChangedToAwaitingValidationDomainEventHandler
|
public class OrderStatusChangedToAwaitingValidationDomainEventHandler
|
||||||
: IAsyncNotificationHandler<OrderStatusChangedToAwaitingValidationDomainEvent>
|
: INotificationHandler<OrderStatusChangedToAwaitingValidationDomainEvent>
|
||||||
{
|
{
|
||||||
private readonly IOrderRepository _orderRepository;
|
private readonly IOrderRepository _orderRepository;
|
||||||
private readonly ILoggerFactory _logger;
|
private readonly ILoggerFactory _logger;
|
||||||
@ -26,7 +27,7 @@
|
|||||||
_orderingIntegrationEventService = orderingIntegrationEventService;
|
_orderingIntegrationEventService = orderingIntegrationEventService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Handle(OrderStatusChangedToAwaitingValidationDomainEvent orderStatusChangedToAwaitingValidationDomainEvent)
|
public async Task Handle(OrderStatusChangedToAwaitingValidationDomainEvent orderStatusChangedToAwaitingValidationDomainEvent, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
_logger.CreateLogger(nameof(OrderStatusChangedToAwaitingValidationDomainEvent))
|
_logger.CreateLogger(nameof(OrderStatusChangedToAwaitingValidationDomainEvent))
|
||||||
.LogTrace($"Order with Id: {orderStatusChangedToAwaitingValidationDomainEvent.OrderId} has been successfully updated with " +
|
.LogTrace($"Order with Id: {orderStatusChangedToAwaitingValidationDomainEvent.OrderId} has been successfully updated with " +
|
||||||
|
@ -9,9 +9,10 @@
|
|||||||
using Ordering.API.Application.IntegrationEvents;
|
using Ordering.API.Application.IntegrationEvents;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Ordering.API.Application.IntegrationEvents.Events;
|
using Ordering.API.Application.IntegrationEvents.Events;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
public class OrderStatusChangedToPaidDomainEventHandler
|
public class OrderStatusChangedToPaidDomainEventHandler
|
||||||
: IAsyncNotificationHandler<OrderStatusChangedToPaidDomainEvent>
|
: INotificationHandler<OrderStatusChangedToPaidDomainEvent>
|
||||||
{
|
{
|
||||||
private readonly IOrderRepository _orderRepository;
|
private readonly IOrderRepository _orderRepository;
|
||||||
private readonly ILoggerFactory _logger;
|
private readonly ILoggerFactory _logger;
|
||||||
@ -26,7 +27,7 @@
|
|||||||
_orderingIntegrationEventService = orderingIntegrationEventService;
|
_orderingIntegrationEventService = orderingIntegrationEventService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Handle(OrderStatusChangedToPaidDomainEvent orderStatusChangedToPaidDomainEvent)
|
public async Task Handle(OrderStatusChangedToPaidDomainEvent orderStatusChangedToPaidDomainEvent, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
_logger.CreateLogger(nameof(OrderStatusChangedToPaidDomainEventHandler))
|
_logger.CreateLogger(nameof(OrderStatusChangedToPaidDomainEventHandler))
|
||||||
.LogTrace($"Order with Id: {orderStatusChangedToPaidDomainEvent.OrderId} has been successfully updated with " +
|
.LogTrace($"Order with Id: {orderStatusChangedToPaidDomainEvent.OrderId} has been successfully updated with " +
|
||||||
|
@ -4,12 +4,13 @@ using Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.Buyer
|
|||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Ordering.Domain.Events;
|
using Ordering.Domain.Events;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Ordering.API.Application.DomainEventHandlers.OrderStartedEvent
|
namespace Ordering.API.Application.DomainEventHandlers.OrderStartedEvent
|
||||||
{
|
{
|
||||||
public class ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler
|
public class ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler
|
||||||
: IAsyncNotificationHandler<OrderStartedDomainEvent>
|
: INotificationHandler<OrderStartedDomainEvent>
|
||||||
{
|
{
|
||||||
private readonly ILoggerFactory _logger;
|
private readonly ILoggerFactory _logger;
|
||||||
private readonly IBuyerRepository _buyerRepository;
|
private readonly IBuyerRepository _buyerRepository;
|
||||||
@ -22,7 +23,7 @@ namespace Ordering.API.Application.DomainEventHandlers.OrderStartedEvent
|
|||||||
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
|
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Handle(OrderStartedDomainEvent orderStartedEvent)
|
public async Task Handle(OrderStartedDomainEvent orderStartedEvent, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var cardTypeId = (orderStartedEvent.CardTypeId != 0) ? orderStartedEvent.CardTypeId : 1;
|
var cardTypeId = (orderStartedEvent.CardTypeId != 0) ? orderStartedEvent.CardTypeId : 1;
|
||||||
var buyer = await _buyerRepository.FindAsync(orderStartedEvent.UserId);
|
var buyer = await _buyerRepository.FindAsync(orderStartedEvent.UserId);
|
||||||
|
@ -8,9 +8,10 @@
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Ordering.API.Application.IntegrationEvents;
|
using Ordering.API.Application.IntegrationEvents;
|
||||||
using Ordering.API.Application.IntegrationEvents.Events;
|
using Ordering.API.Application.IntegrationEvents.Events;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
public class OrderStatusChangedToStockConfirmedDomainEventHandler
|
public class OrderStatusChangedToStockConfirmedDomainEventHandler
|
||||||
: IAsyncNotificationHandler<OrderStatusChangedToStockConfirmedDomainEvent>
|
: INotificationHandler<OrderStatusChangedToStockConfirmedDomainEvent>
|
||||||
{
|
{
|
||||||
private readonly IOrderRepository _orderRepository;
|
private readonly IOrderRepository _orderRepository;
|
||||||
private readonly ILoggerFactory _logger;
|
private readonly ILoggerFactory _logger;
|
||||||
@ -25,7 +26,7 @@
|
|||||||
_orderingIntegrationEventService = orderingIntegrationEventService;
|
_orderingIntegrationEventService = orderingIntegrationEventService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Handle(OrderStatusChangedToStockConfirmedDomainEvent orderStatusChangedToStockConfirmedDomainEvent)
|
public async Task Handle(OrderStatusChangedToStockConfirmedDomainEvent orderStatusChangedToStockConfirmedDomainEvent, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
_logger.CreateLogger(nameof(OrderStatusChangedToStockConfirmedDomainEventHandler))
|
_logger.CreateLogger(nameof(OrderStatusChangedToStockConfirmedDomainEventHandler))
|
||||||
.LogTrace($"Order with Id: {orderStatusChangedToStockConfirmedDomainEvent.OrderId} has been successfully updated with " +
|
.LogTrace($"Order with Id: {orderStatusChangedToStockConfirmedDomainEvent.OrderId} has been successfully updated with " +
|
||||||
|
@ -21,11 +21,11 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure.Autof
|
|||||||
|
|
||||||
// Register all the Command classes (they implement IAsyncRequestHandler) in assembly holding the Commands
|
// Register all the Command classes (they implement IAsyncRequestHandler) in assembly holding the Commands
|
||||||
builder.RegisterAssemblyTypes(typeof(CreateOrderCommand).GetTypeInfo().Assembly)
|
builder.RegisterAssemblyTypes(typeof(CreateOrderCommand).GetTypeInfo().Assembly)
|
||||||
.AsClosedTypesOf(typeof(IAsyncRequestHandler<,>));
|
.AsClosedTypesOf(typeof(IRequestHandler<,>));
|
||||||
|
|
||||||
// Register the DomainEventHandler classes (they implement IAsyncNotificationHandler<>) in assembly holding the Domain Events
|
// Register the DomainEventHandler classes (they implement IAsyncNotificationHandler<>) in assembly holding the Domain Events
|
||||||
builder.RegisterAssemblyTypes(typeof(ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler).GetTypeInfo().Assembly)
|
builder.RegisterAssemblyTypes(typeof(ValidateOrAddBuyerAggregateWhenOrderStartedDomainEventHandler).GetTypeInfo().Assembly)
|
||||||
.AsClosedTypesOf(typeof(IAsyncNotificationHandler<>));
|
.AsClosedTypesOf(typeof(INotificationHandler<>));
|
||||||
|
|
||||||
// Register the Command's Validators (Validators based on FluentValidation library)
|
// Register the Command's Validators (Validators based on FluentValidation library)
|
||||||
builder
|
builder
|
||||||
|
@ -31,14 +31,14 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="FluentValidation.AspNetCore" Version="7.2.1" />
|
<PackageReference Include="FluentValidation.AspNetCore" Version="7.2.1" />
|
||||||
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="3.0.0" />
|
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="4.0.0" />
|
||||||
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.2.0" />
|
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.2.0" />
|
||||||
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
|
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.1.1" />
|
||||||
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.4.1" />
|
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.4.1" />
|
||||||
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.0.0-beta1" />
|
<PackageReference Include="Microsoft.ApplicationInsights.Kubernetes" Version="1.0.0-beta1" />
|
||||||
<PackageReference Include="Microsoft.ApplicationInsights.ServiceFabric" Version="2.0.1-beta1" />
|
<PackageReference Include="Microsoft.ApplicationInsights.ServiceFabric" Version="2.0.1-beta1" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
|
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
|
||||||
<PackageReference Include="MediatR" Version="3.0.1" />
|
<PackageReference Include="MediatR" Version="4.0.1" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.1.0" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="1.1.0" />
|
||||||
<PackageReference Include="System.Reflection" Version="4.3.0" />
|
<PackageReference Include="System.Reflection" Version="4.3.0" />
|
||||||
<PackageReference Include="Dapper" Version="1.50.4" />
|
<PackageReference Include="Dapper" Version="1.50.4" />
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="MediatR" Version="3.0.1" />
|
<PackageReference Include="MediatR" Version="4.0.1" />
|
||||||
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="3.0.0" />
|
<PackageReference Include="MediatR.Extensions.Microsoft.DependencyInjection" Version="4.0.0" />
|
||||||
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.4.0" />
|
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.4.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user