private TemperatureMeasurement(Guid measurementId) { Guard.Against.Default(measurementId, nameof(measurementId)); var @event = TemperatureMeasurementStarted.Create( measurementId ); Enqueue(@event); Apply(@event); }
private TemperatureMeasurement(Guid measurementId) { if (measurementId == Guid.Empty) { throw new ArgumentOutOfRangeException(nameof(measurementId)); } var @event = TemperatureMeasurementStarted.Create( measurementId ); Enqueue(@event); Apply(@event); }
public void Apply(TemperatureMeasurementStarted @event) { Id = @event.MeasurementId; Started = @event.StartedAt; Mesurements = new List <decimal>(); }