public void When(AuctionOpened @event) { EndDate = @event.EndDate; StartDate = @event.StartDate; StartingPrice = @event.StartingPrice; SellerId = @event.SellerId; }
//public override void Apply(DomainEvent @event) //{ // When((dynamic) @event); //} private void When(AuctionOpened @event) { this.Id = @event.Id; this.SellerId = @event.SellerId; this.StartingPrice = @event.StartingPrice; this.Product = @event.Product; this.EndDate = @event.EndDate; }
private void Apply(AuctionOpened @event) { this.Id = @event.Id; this.EndDateTime = @event.EndDateTime; this.ProductDescription = @event.ProductDescription; this.SellerId = @event.SellerId; this.StartingPrice = @event.StartingPrice; }
public Auction(long auctionId, long sellerId, long startingPrice, DateTime endDate) { var @event = new AuctionOpened(auctionId, sellerId, startingPrice, endDate); Apply(@event); }