public async Task <Guid> CreateNewRentalAsync(Rental rental, CancellationToken cancellationToken = default) { if (rental == null) { throw new ArgumentNullException(nameof(rental)); } var rentalId = await rentalRepository.AddAsync(rental.CreateDtoRental(), cancellationToken); await rentalRecordsRepository.AddAsync(rental.CreateDtoRentalRecord(), cancellationToken); return(rentalId); }
public async Task AddRentalAsync() { await rentalRepository.AddAsync(rental); }