public async Task AddCardAsync(Card card, CancellationToken cancellationToken = default) { if (card == null) { throw new ArgumentNullException(nameof(card)); } if (card.UserId == Guid.Empty) { throw new ArgumentNullException(nameof(card.UserId)); } await cardRepository.AddAsync(card.CreateDtoCard()); await userCardRepository.AddAsync(card.CreateUserCardDTO()); await addressRepository.AddAsync(card.BillingAddress.CreateDtoAddress()); }
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 userCardRepository.AddAsync(userCard); }