Exemplo n.º 1
0
 public HomeController(ILogger <HomeController> logger,
                       ICookingRecipeService cookingRecipeService,
                       ICloudinaryService cloudinaryService,
                       IInspirationRepository inspirationRepository)
 {
     this._logger = logger;
     this.cookingRecipeService  = cookingRecipeService;
     this.cloudinaryService     = cloudinaryService;
     this.inspirationRepository = inspirationRepository;
 }
Exemplo n.º 2
0
        private async Task <List <string> > GetRelatedKeyphrases(IInspirationRepository repo, string text, int num = 5, int page = 0)
        {
            var results = await repo.Search(text, num, page);

            var keyPhrases = await _textAnalytics.KeyPhrases(results, t => t.Id, t => t.Title + " " + t.Summary);

            var collection = new List <string>();

            foreach (var l in keyPhrases.Values)
            {
                collection.AddRange(l);
            }

            return(collection);
        }