public async Task <Response <bool> > Handle(AddBookCommand request, CancellationToken cancellationToken) { var uploadedBookPhotosData = await fileManager.AddMultipleFileAsync(request.BookPhotos, FileTypeEnum.BookPhoto); var uploadedBookFileData = await fileManager.AddFileAsync(request.BookFile, FileTypeEnum.BookFile); var book = new Book { publishDate = request.PublishedDate, BookName = request.BookName, AuthorId = request.Userid, Price = request.Price, Category = (BookCategoryEnum)request.Category, Description = request.Description, File = new File { Url = uploadedBookFileData.Url, Path = uploadedBookFileData.Path }, Imgs = uploadedBookPhotosData.Select(u => new Img { Url = u.Url, Path = u.Path }).ToList() }; await bookRepo.AddAsync(book); return(Response.Ok()); }