Пример #1
0
        public async Task AddCardAsync(Card card, Guid userId)
        {
            if (card == null)
            {
                throw new ArgumentNullException(nameof(card));
            }

            if (userId == Guid.Empty)
            {
                throw new ArgumentNullException(nameof(userId));
            }

            var cardId = await cardRepository.AddAsync(card.CreateDtoCard());

            var addressId = await addressRepository.AddAsync(card.BillingAddress.CreateDtoAddress());

            await userCardRepository.AddAsync(userId.CreateUserCardDTO(cardId));

            await cardAddressRepository.AddAsync(cardId.CreateCardAddressDTO(addressId));
        }
 public async Task AddUserCard()
 {
     await cardAddressRepository.AddAsync(cardAddress);
 }