Пример #1
0
        public override async Task EditWishlist(AddPersonCommand command, Wishlist wishlist)
        {
            Guid personId;
            var  person = await wishlistSummaryRepository.GetUserFromEmail(command.PersonEmail);

            if (person == null)
            {
                personId = Guid.NewGuid();
                await this.wishlistSummaryRepository.CreatePerson(personId, command.PersonEmail, command.PersonName);
            }
            else
            {
                personId = person.Id;
            }
            wishlist.AddPerson(personId, command.IsGiftee);
            await this._mediator.Publish(new PersonAddedToWishlist(personId, wishlist.Id));
        }