public ListingCreated(Guid id, Location location, Description description, decimal price) { Id = id; Location = location; Description = description; Price = price; }
private void ApplyEvent(ListingCreated @event) { Id = @event.Id; _location = @event.Location; _description = @event.Description; _price = @event.Price; _posted = false; }
public Listing(Guid id, Location location, Description description, decimal price) : base(id) { _location = location; _description = description; _price = price; _posted = false; PublishAndApplyEvent(new ListingCreated(id, location, description, price)); }
public Listing(IAggregateBus aggregateBus, Guid id, Location location, Description description, decimal price) : base(aggregateBus, id) { _location = location; _description = description; _price = price; _posted = false; PublishAndApplyEventAsync(new ListingCreated(id, location, description, price)).ConfigureAwait(true); }