public async Task <Response> Handle(Request request, CancellationToken cancellationToken) { var number = RandomNumber(); if (number > 14) { throw new Exception(); } return(new Response() { Companies = await _context.Companies.Select(x => CompanyDto.FromCompany(x)).ToListAsync() }); }
public async Task <Response> Handle(Request request, CancellationToken cancellationToken) => new Response() { Companies = await _context.Companies.Select(x => CompanyDto.FromCompany(x)).ToListAsync() };