public async Task <Unit> Handle(CreatePayerCommand request, CancellationToken cancellationToken)
        {
            var payer = Payer.Create(request.UserId, request.Login, request.Email, request.FirstName, request.LastName,
                                     request.Name);

            await _payerRepository.AddAsync(payer);

            return(Unit.Value);
        }
Ejemplo n.º 2
0
        public void CreatePayer_IsSuccessful()
        {
            var payerId = Guid.NewGuid();
            var payer   = Payer.Create(payerId, "payerLogin", "*****@*****.**",
                                       "John", "Doe", "John Doe");

            var payerCreated = AssertPublishedDomainEvent <PayerCreatedDomainEvent>(payer);

            Assert.That(payerCreated.PayerId, Is.EqualTo(payerId));
        }
        public Task <Guid> Handle(CreatePayerCommand request, CancellationToken cancellationToken)
        {
            var payer = Payer.Create(
                request.UserId,
                request.Login,
                request.Email,
                request.FirstName,
                request.LastName,
                request.Name);

            _aggregateStore.AppendChanges(payer);

            return(Task.FromResult(payer.Id));
        }