public async Task <IActionResult> GetAllRecipes() { // Synchronous //var allRecipes = _repository.GetAllRecipes(); //return allRecipes.ToList(); IEnumerable <Recipe> allRecipes = await _repository.GetAllRecipes(); var mappedResult = _mapper.Map <IEnumerable <RecipeReadDto> >(allRecipes); return(StatusCode(200, new { status = "success", statusCode = 200, message = "Data successfully retrieved!", data = mappedResult })); }
private void ShowAllRecipes() { RecipeNames.ReplaceWith(_recipeRepo.GetAllRecipes()); }