Rename refactoring
This commit is contained in:
@@ -25,7 +25,7 @@
|
|||||||
[HttpGet("/Home/Search")]
|
[HttpGet("/Home/Search")]
|
||||||
public async Task<IActionResult> Search(string query)
|
public async Task<IActionResult> Search(string query)
|
||||||
{
|
{
|
||||||
var recipes = await _recipeRepository.SearchRecipeAsync(query);
|
var recipes = await _recipeRepository.SearchInRecipesandIngredients(query);
|
||||||
return PartialView("_SearchResultsPartial", recipes);
|
return PartialView("_SearchResultsPartial", recipes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,6 @@
|
|||||||
|
|
||||||
Task<Recipe> CreateRecipeForCategoryAsync(Category category, string name, string description, Difficulty difficulty, int servings, TimeSpan preparationTime, TimeSpan cookingTime);
|
Task<Recipe> CreateRecipeForCategoryAsync(Category category, string name, string description, Difficulty difficulty, int servings, TimeSpan preparationTime, TimeSpan cookingTime);
|
||||||
|
|
||||||
Task<IEnumerable<Recipe>> SearchRecipeAsync(string searchterm);
|
Task<IEnumerable<Recipe>> SearchInRecipesandIngredients(string searchterm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,7 +147,7 @@
|
|||||||
await _context.SaveChangesAsync();
|
await _context.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<IEnumerable<Recipe>> SearchRecipeAsync(string searchTerm)
|
public async Task<IEnumerable<Recipe>> SearchInRecipesandIngredients(string searchTerm)
|
||||||
{
|
{
|
||||||
var queryable = _context.Recipes
|
var queryable = _context.Recipes
|
||||||
.Include(r => r.RecipeIngredients)
|
.Include(r => r.RecipeIngredients)
|
||||||
|
|||||||
Reference in New Issue
Block a user