Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public async Task AddRentalAsync()
 {
     await rentalRepository.AddAsync(rental);
 }