Ejemplo n.º 1
0
        public async Task <List <Rule> > GetSuitableRules(Guid transactionId, Guid userId)
        {
            var categoryRow = await transactionCategoryService.Get(transactionId, userId);

            var cachedEvaluator = await cachedEvaluatorFactory.Create(userId);

            return((await ruleRepository
                    .GetRules(userId))
                   .Where(r => cachedEvaluator.Evaluate(r.ExpressionId, categoryRow))
                   .ToList());
        }