Example #1
0
        public async Task PredictAsync(PredictBankStatement2Command command, IPredict predict)
        {
            var results = await predict.PredictManyAsync(State.PredictionRequests);

            var predictionResults = results as PredictionResult[] ?? results.ToArray();

            if (predictionResults.Any(x => x == null))
            {
                throw new ApplicationException();
            }
            var ev = new BankStatementPredicted2Event
            {
                PredictionResults = predictionResults
            };

            Emit(ev);

            await Task.CompletedTask;
        }
Example #2
0
 public void Apply(BankStatementPredicted2Event aggregateEvent)
 {
     PredictionResults = aggregateEvent.PredictionResults;
 }