예제 #1
0
        /// <summary>
        /// Sets the collections.
        /// </summary>
        public void Loaded()
        {
            Categories     = _categoryRepo.GetCategories();
            AllIngredients = _ingredientRepo.GetIngredients();

            ProductRecipeItems = new ObservableCollection <Data.RecipeItem>(_recipeRepo.GetRecipes()
                                                                            .Where(r => r.Product.ID.Equals(SelectedRecipeItem.Product.ID)));
        }
예제 #2
0
        public IEnumerable <IngredientDto> ServiceGetIngredients()
        {
            var ingredient = _ingredientRepository.GetIngredients();

            if (ingredient == null)
            {
                return(null);
            }
            return(ingredient.Select(x => x).ToList());
        }
예제 #3
0
        public IEnumerable <Ingredient> GetIngredient()
        {
            IEnumerable <Ingredient> ingredients = _ingredientRepo.GetIngredients();

            if (ingredients != null)
            {
                _logger.LogInformation("Getting all ingredients.");
                return(ingredients.ToList());
            }
            _logger.LogWarning("Attempted to get ingredients but no ingredients were available.");
            return(null);
        }
예제 #4
0
 public void Loaded()
 {
     _iProductRepo.GetProducts();
     _iIngredientRepo.GetIngredients();
 }