Пример #1
0
        public static Pizza CreatePizza(DtoPizza dtoPizza)
        {
            var pizza = new Pizza()
            {
                Name  = dtoPizza.Name,
                Photo = dtoPizza.Photo,
                Collection_Ingredient = dtoPizza.Collection_Ingredient
            };

            return(pizza);
        }
Пример #2
0
        public static Pizza Create(DtoPizza dato, IEnumerable <Ingredient> ingredients)
        {
            var pizza = new Pizza()
            {
                Name        = dato.Name,
                Picture     = dato.Picture,
                FormItem    = dato.FormItems,
                Ingredients = ingredients.ToList()
            };

            return(pizza);
        }