Exemplo n.º 1
0
        public async Task <DataSourceGrid <LogDTO> > GetGridLogs(ShowLogFilterParameters parameters)
        {
            List <FilterDefinition <Log> > rules = new List <FilterDefinition <Log> >();
            FilterDefinition <Log>         filter;

            foreach (var rule in parameters.RulesSet.Rules)
            {
                rules.Add(ShowLogFilterBuilder.BuildFilter(rule));
            }
            filter = ShowLogFilterBuilder.GetConditionFilters(parameters.RulesSet, rules);
            var logs = await _dbService.Logs.GetAsync(filter, parameters.Skip, parameters.Take);

            var dataSource = new DataSourceGrid <LogDTO>();

            dataSource.Data = logs.Select(o => new LogDTO()
            {
                MessageId    = o.MessageId,
                RequestDate  = o.RequestDate,
                Request      = _processLogTree.GetTree(o.Request),
                ResponseDate = o.ResponseDate,
                Response     = _processLogTree.GetTree(o.Response)
            });
            dataSource.CountLogs = await _dbService.Logs.Count(filter);

            return(dataSource);
        }
Exemplo n.º 2
0
 public IEnumerable <TreeNode> GetTreeAnswer(BsonDocument answerDocument)
 {
     return(_processLogTree.GetTree(answerDocument));
 }