コード例 #1
0
ファイル: BookService.cs プロジェクト: VismaLietuva/simoona
        public async Task <RetrievedBookInfoDto> FindBookByIsbnAsync(string isbn, int organizationId)
        {
            var bookAlreadyExists = _booksDbSet
                                    .Any(book =>
                                         book.OrganizationId == organizationId &&
                                         book.Code == isbn);

            _bookServiceValidator.CheckIfBookAlreadyExists(bookAlreadyExists);

            var result = await _bookInfoService.FindBookByIsbnAsync(isbn);

            _bookServiceValidator.CheckIfBookWasFoundByIsbnFromExternalProvider(result);
            var retrievedBookDto = MapBookInfoToDto(result);

            return(retrievedBookDto);
        }