コード例 #1
0
ファイル: Something.cs プロジェクト: thefringeninja/Craicto
        public static Something Happens(SomethingIdentifier identifier)
        {
            var something = Factory();

            something.Apply(new SomethingHappened {
                SomethingId = identifier.ToGuid()
            });

            return(something);
        }
コード例 #2
0
ファイル: Something.cs プロジェクト: thefringeninja/Craicto
        public void ElseDo()
        {
            if (!_somethingHappened)
            {
                throw new InvalidOperationException();
            }

            if (_somethingElseHappened)
            {
                throw new InvalidOperationException();
            }

            Apply(new SomethingElseHappened {
                SomethingId = _identifier.ToGuid()
            });
        }
コード例 #3
0
 private static string GetStreamId(SomethingIdentifier identifier) => $"something-{identifier.ToGuid():n}";