Exemple #1
0
            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()
                });
            }
Exemple #2
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     Companies = await _context.Companies.Select(x => CompanyDto.FromCompany(x)).ToListAsync()
 };