public static Something Happens(SomethingIdentifier identifier) { var something = Factory(); something.Apply(new SomethingHappened { SomethingId = identifier.ToGuid() }); return(something); }
public void ElseDo() { if (!_somethingHappened) { throw new InvalidOperationException(); } if (_somethingElseHappened) { throw new InvalidOperationException(); } Apply(new SomethingElseHappened { SomethingId = _identifier.ToGuid() }); }
private static string GetStreamId(SomethingIdentifier identifier) => $"something-{identifier.ToGuid():n}";