コード例 #1
0
        private Ingredient toDatabaseIngredient(CookbookRepositoryIngredient cookbookRepositoryIngredient)
        {
            Ingredient recipe = new Ingredient
            {
                Id       = cookbookRepositoryIngredient.ID,
                Name     = cookbookRepositoryIngredient.Name,
                Price    = cookbookRepositoryIngredient.Price,
                ImageUrl = cookbookRepositoryIngredient.ImageURL
            };

            return(recipe);
        }
コード例 #2
0
        private Ingredient saveIngredient(CookbookRepositoryIngredient cookbookRepositoryIngredient)
        {
            Ingredient ingredient = new Ingredient
            {
                Id       = cookbookRepositoryIngredient.ID,
                Name     = cookbookRepositoryIngredient.Name,
                Price    = cookbookRepositoryIngredient.Price,
                ImageUrl = cookbookRepositoryIngredient.ImageURL
            };

            DatabaseManager.Instance.Ingredient.Add(ingredient);
            return(ingredient);
        }