Example #1
0
        public async Task GetEventsAsync(int page, DateTime?startingTs, LogQueryFilter queryFilter)
        {
            var events = await _repository.GetEventsPageAsync(page == 0? 1 : page, startingTs, queryFilter);

            _context.Response.ContentType = "application/json";
            await _context.Response.WriteAsync(JsonConvert.SerializeObject(events, _camelCaseSerializerSetting));
        }
Example #2
0
        public async Task GetEventsAsync(int page, DateTime?startingTs, LogQueryFilter queryFilter)
        {
            var events = await _repository.GetEventsPageAsync(page == 0? 1 : page, startingTs, queryFilter);

            _context.Response.ContentType = "application/json";
            await _context.Response.WriteAsync(JsonSerializer.Serialize(events, ApplicationBuilderExtensions._camelCaseJson));
        }
Example #3
0
        public async Task GetEventsAsync(int page, DateTime?startingTs, LogQueryFilter queryFilter)
        {
            try
            {
                var events = await _repository.GetEventsPageAsync(page == 0? 1 : page, startingTs, queryFilter);

                _context.Response.ContentType = "application/json";
                await _context.Response.WriteAsync(JsonSerializer.Serialize(events, ApplicationBuilderExtensions._camelCaseJson));
            }
            catch (QueryEngineException ex)
            {
                _context.Response.ContentType = "application/json";
                _context.Response.StatusCode  = StatusCodes.Status400BadRequest;
                await _context.Response.WriteAsync(JsonSerializer.Serialize(new { error = ex.Message }, ApplicationBuilderExtensions._camelCaseJson));
            }
        }