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