public async Task RB(IDialogContext context, LuisResult result)
        {
            var entitiesArray = result.Entities;
            //    int k = 0;
            var resultMessage = context.MakeMessage();

            if (result.Query.StartsWith("Getting details of "))
            {
                string activity = result.Query;

                string titl = "", auth = "";
                int    lenby = activity.IndexOf("By "), lenend = activity.Length;
                titl = activity.Substring(22, lenby - 22);
                auth = activity.Substring((lenby + 3), (lenend - lenby - 3));
                var GRser1 = await BookService.GetBookInfo1(titl, auth);


                resultMessage.AttachmentLayout = AttachmentLayoutTypes.Carousel;
                resultMessage.Attachments      = new List <Attachment>();
                string        desc    = ((GRser1.items[0].volumeInfo.description.Length < 300) ? GRser1.items[0].volumeInfo.description : (GRser1.items[0].volumeInfo.description.Substring(0, 300) + "..."));
                ThumbnailCard plCard1 = new ThumbnailCard()
                {
                    Title    = GRser1.items[0].volumeInfo.title,
                    Subtitle = $"Author: \n{GRser1.items[0].volumeInfo.authors[0]} \n\nRating: \n{GRser1.items[0].volumeInfo.averageRating} \n\nDescription:  {desc}",
                    Images   = new List <CardImage>()
                    {
                        new CardImage()
                        {
                            Url = GRser1.items[0].volumeInfo.imageLinks.thumbnail,
                        }
                    },
                    Buttons = new List <CardAction>()
                    {
                        new CardAction()
                        {
                            Title = "Preview Link",
                            Type  = ActionTypes.OpenUrl,
                            Value = GRser1.items[0].volumeInfo.previewLink,
                        },
                        new CardAction()
                        {
                            Title = "Buy Book",
                            Type  = ActionTypes.OpenUrl,
                            Value = GRser1.items[0].saleInfo.buyLink,
                        }
                    }
                };
                Attachment plAttachment1 = plCard1.ToAttachment();
                resultMessage.Attachments.Add(plAttachment1);
                await context.PostAsync(resultMessage);
            }
            else
            {
                foreach (var entityItem in result.Entities)
                {
                    if (entityItem.Type == "bookTitle")
                    {
                        int i     = 0;
                        var GRser = await RecommendationService.GetRecommendationInfo(entityItem.Entity);

                        resultMessage.AttachmentLayout = AttachmentLayoutTypes.Carousel;
                        resultMessage.Attachments      = new List <Attachment>();

                        foreach (var item in GRser.book.similar_books)
                        {
                            HeroCard plCard = new HeroCard()
                            {
                                Title    = item.title,
                                Subtitle = item.authors.author.name,
                                Images   = new List <CardImage>()
                                {
                                    new CardImage()
                                    {
                                        Url = item.image_url
                                    },
                                },
                                Buttons = new List <CardAction>()
                                {
                                    new CardAction()
                                    {
                                        Title = "More details",
                                        Type  = ActionTypes.ImBack,
                                        Value = "Getting the details of " + item.title + " By " + item.authors.author.name
                                    }
                                }
                            };
                            Attachment plAttachment = plCard.ToAttachment();
                            resultMessage.Attachments.Add(plAttachment);
                            i++;
                        }

                        await context.PostAsync(resultMessage);
                    }

                    if (entityItem.Type == "author")
                    {
                        int i     = 0;
                        var GRser = await AuthorService.GetAuthorInfo(entityItem.Entity);

                        resultMessage.AttachmentLayout = AttachmentLayoutTypes.Carousel;
                        resultMessage.Attachments      = new List <Attachment>();

                        foreach (var item in GRser.search.results)
                        {
                            HeroCard plCard = new HeroCard()
                            {
                                Title    = item.best_book.title,
                                Subtitle = item.best_book.author.name,
                                Images   = new List <CardImage>()
                                {
                                    new CardImage()
                                    {
                                        Url = item.best_book.image_url
                                    },
                                },
                                Buttons = new List <CardAction>()
                                {
                                    new CardAction()
                                    {
                                        Title = "Get details",
                                        Type  = ActionTypes.ImBack,
                                        Value = "Getting the details of " + item.best_book.title + " By " + item.best_book.author.name
                                    }
                                }
                            };
                            Attachment plAttachment = plCard.ToAttachment();
                            resultMessage.Attachments.Add(plAttachment);
                            i++;
                        }

                        await context.PostAsync(resultMessage);
                    }

                    if (entityItem.Type == "genre")
                    {
                        int i     = 0;
                        var GRser = await GenreService.GetGenreInfo(entityItem.Entity);

                        resultMessage.AttachmentLayout = AttachmentLayoutTypes.Carousel;
                        resultMessage.Attachments      = new List <Attachment>();
                        var GRser1 = await BookService.GetBookInfo(entityItem.Entity);

                        foreach (var item in GRser.book)
                        {
                            HeroCard plCard = new HeroCard()
                            {
                                Title    = item.title,
                                Subtitle = item.author,
                                Buttons  = new List <CardAction>()
                                {
                                    new CardAction()
                                    {
                                        Title = "Get Details",
                                        Type  = ActionTypes.ImBack,
                                        Value = "Getting the details of " + item.title + " By " + item.author
                                    }
                                }
                            };
                            Attachment plAttachment = plCard.ToAttachment();
                            resultMessage.Attachments.Add(plAttachment);
                            i++;
                        }

                        await context.PostAsync(resultMessage);
                    }
                }
            }
            context.Wait(this.MessageReceived);
        }