Ejemplo n.º 1
0
        public IActionResult Search([FromBody] FormulaSearchModel model)
        {
            Guard.AgainstNull(model, nameof(model));

            using (_databaseContextFactory.Create())
            {
                return(Ok(new
                {
                    Data = _dataRowMapper.MapObjects <FormulaModel>(
                        _formulaQuery.Search(model.Specification()))
                }));
            }
        }
Ejemplo n.º 2
0
        public IEnumerable <Formula> All()
        {
            var result = new List <Formula>();

            foreach (var row in _query.Search(new FormulaSearchSpecification()))
            {
                var id = Columns.Id.MapFrom(row);

                var formula = new Formula(id);
                var stream  = _eventStore.Get(id);

                stream.Apply(formula);

                result.Add(formula);
            }

            return(result);
        }