public async Task <Unit> Handle(CreateClientCommand request, CancellationToken cancellationToken)
            {
                HLClientResult hlClientResult = await _hlClient.CreateClient(request.AdvisorEmail, request.Name, request.Email, request.Phone, request.Id);

                var entity = _mapper.MergeInto <Client>(request, hlClientResult);

                _context.Clients.Add(entity);

                await _context.SaveChangesAsync(cancellationToken);

                return(Unit.Value);
            }
Ejemplo n.º 2
0
            public async Task <Unit> Handle(CreateStressTestForClient request, CancellationToken cancellationToken)
            {
                var stressTestInput = _mapper.Map <HLInput>(request);

                var entity = await _hlClient.CreateStressTest(stressTestInput);

                entity.ClientId = request.ClientId;

                _context.StressTests.Add(entity);

                await _context.SaveChangesAsync(cancellationToken);

                return(Unit.Value);
            }