Esempio n. 1
0
        public async Task <Unit> Handle(BorrowBookCommand command, CancellationToken cancellationToken)
        {
            var storage = await _storageRepository.GetAsync(_storageConfig.DevelopStorageId);

            var dateTimePeriod = DateTimePeriod.Create(command.BorrowingStartDate, command.BorrowingEndDate);

            storage.BorrowBook(command.BookId, _tokenAuthInfo.UserId, dateTimePeriod);

            await _storageRepository.SaveChangesAsync();

            return(Unit.Value);
        }
 internal DateTimePeriod Act(DateTime startDate, DateTime endDate)
 => DateTimePeriod.Create(startDate, endDate);