コード例 #1
0
ファイル: QuizAggregateTests.cs プロジェクト: yuyul/quiz
        private QuizAggregate ExecuteCommand(Action <QuizAggregate> command)
        {
            var quizId = Guid.NewGuid();
            var quiz   = QuizAggregate.Create(quizId);

            command(quiz);
            return(quiz);
        }
コード例 #2
0
        private async Task <QuizAggregate> CreateAggregate(IDocumentSession session, Guid quizId)
        {
            var events = (await session.Events.FetchStreamAsync(quizId)).Select(@event => @event.Data).ToArray();

            return(QuizAggregate.Create(quizId, events));
        }