Minor clean-up on Entity, Domain Events.

This commit is contained in:
Cesar De la Torre 2017-11-07 16:53:41 -08:00
parent a88fbf339f
commit d2f7d6a5d6
4 changed files with 11 additions and 11 deletions

View File

@ -178,8 +178,8 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
private void AddOrderStartedDomainEvent(string userId, int cardTypeId, string cardNumber,
string cardSecurityNumber, string cardHolderName, DateTime cardExpiration)
{
var orderStartedDomainEvent = new OrderStartedDomainEvent(
this, userId, cardTypeId, cardNumber, cardSecurityNumber,
var orderStartedDomainEvent = new OrderStartedDomainEvent(this, userId, cardTypeId,
cardNumber, cardSecurityNumber,
cardHolderName, cardExpiration);
this.AddDomainEvent(orderStartedDomainEvent);
@ -187,7 +187,7 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.O
private void StatusChangeException(OrderStatus orderStatusToChange)
{
throw new OrderingDomainException($"Not possible to change order status from {OrderStatus.Name} to {orderStatusToChange.Name}.");
throw new OrderingDomainException($"Is not possible to change the order status from {OrderStatus.Name} to {orderStatusToChange.Name}.");
}
public decimal GetTotal()

View File

@ -9,8 +9,7 @@ namespace Ordering.Domain.Events
/// <summary>
/// Event used when an order is created
/// </summary>
public class OrderStartedDomainEvent
: INotification
public class OrderStartedDomainEvent : INotification
{
public string UserId { get; private set; }
public int CardTypeId { get; private set; }

View File

@ -22,6 +22,7 @@
private List<INotification> _domainEvents;
public List<INotification> DomainEvents => _domainEvents;
public void AddDomainEvent(INotification eventItem)
{
_domainEvents = _domainEvents ?? new List<INotification>();