public PaginationQueryDto Query(PaginationQueryTaskLogInput input)
        {
            if (input == null)
            {
                throw new ArgumentNullException($"{nameof(input)} should not be null.");
            }

            var identity = input.Identity;

            Expression <Func <Core.Entities.TaskLog, bool> > where = t => t.Identity == identity;

            var nodeId = input.NodeId;

            if (!string.IsNullOrWhiteSpace(nodeId))
            {
                where = where.AndAlso(t => t.NodeId == nodeId);
            }

            var logType = input.LogType.Trim().ToLower();

            if (!string.IsNullOrWhiteSpace(logType) && "all" != logType)
            {
                where = where.AndAlso(t => t.Level.ToLower() == logType);
            }
            var output = DbContext.TaskLog.PageList <Core.Entities.TaskLog, long, DateTime?>(input, where, t => t.Logged);

            output.Result = Mapper.Map <List <TaskLogOutput> >(output.Result);
            return(output);
        }
Exemplo n.º 2
0
 public IActionResult Find(PaginationQueryTaskLogInput input)
 {
     return(Success(_logAppService.Query(input)));
 }