Exemple #1
0
 public Task <IEnumerable <Recipe> > GetRecipesByTime(double maxTime)
 {
     return(Task.Run(() => RecipesFactory
                     .GetRecipesWithBasicDetails()
                     .Where(x => x.TimeInMinutes <= maxTime)));
 }
Exemple #2
0
 public Task <IEnumerable <Recipe> > GetRecipesByCategory(string category)
 {
     return(Task.Run(() => RecipesFactory
                     .GetRecipesWithBasicDetails()
                     .Where(x => x.Category.ToString() == category)));
 }
Exemple #3
0
 public Task <IEnumerable <Recipe> > GetRecipeByIngredients(string[] ingredients)
 {
     return(Task.Run(() => RecipesFactory
                     .GetRecipesWithBasicDetails()
                     .Where(x => x.Ingredients.Any(i => ingredients.Contains(i.Name)))));
 }