public async ValueTask Read(ErrorsContext context, ErrorFilterRequest filter)
        {
            var errors = context.Errors.AsNoTracking();

            if (filter.TraceId != null)
            {
                errors = errors.Where(e => e.TraceIds.Any(t => t.Id == filter.TraceId));
            }

            if (filter.Project != null)
            {
                errors = errors.Where(e => e.Project == filter.Project);
            }

            if (filter.Type != null)
            {
                errors = errors.Where(e => e.Type == filter.Type);
            }

            if (filter.From != null)
            {
                errors = errors.Where(e => e.Created >= filter.From);
            }

            if (filter.To != null)
            {
                errors = errors.Where(e => e.Created <= filter.To);
            }

            Errors = await errors
                     .Include(e => e.TraceIds)
                     .OrderByDescending(e => e.Created)
                     .Skip(filter.Offset)
                     .Take(filter.Limit)
                     .Select(error => new AdminReadErrorsResponseItem(error))
                     .ToListAsync();
        }
 public ErrorsExceptionPayloadConsumer(ErrorsContext context)
 {
     this.context = context;
 }
        public async Task Delete(ErrorsContext context)
        {
            var error = await context.Errors.FirstAsync(e => e.Id == ErrorId);

            context.Remove(error);
        }
示例#4
0
 public ErrorsController(ErrorsContext context)
 {
     this.context = context;
 }