Exemple #1
0
        public async Task <IActionResult> GetTraceLogs([FromQuery] int skip = 0, [FromQuery] int take = 100, [FromQuery] bool descending = true)
        {
            if (take > 1000)
            {
                take = 1000;
            }

            var traceLogs = await _traceRepo.GetAll().OrderByDescending(t => t.CreatedTime).Skip(skip).Take(take).ToListAsync();

            if (traceLogs.IsNullOrEmpty())
            {
                return(NoContent());
            }
            else
            {
                return(Ok(CreateMessage(traceLogs, descending)));
            }
        }