Esempio n. 1
0
        public static CheeseTopping MapToCheeseTopping(CheeseToppingDAO cheeseTopping)
        {
            var ct = new CheeseTopping();

            ct.CheeseToppingID = cheeseTopping.Id;
            ct.PizzaID         = PizzaMapper.MapToPizza(cheeseTopping.Pizza).PizzaID;
            ct.CheeseID        = CheeseMapper.MapToCheese(cheeseTopping.Cheese).CheeseID;
            ct.Active          = cheeseTopping.Active;

            return(ct);
        }
        public static Pizza MapToPizza(PizzaDAO pizza)
        {
            var p = new Pizza();

            p.PizzaID  = pizza.Id;
            p.SizeID   = SizeMapper.MapToSize(pizza.Size).SizeID;
            p.CrustID  = CrustMapper.MapToCrust(pizza.Crust).CrustID;
            p.SauceID  = SauceMapper.MapToSauce(pizza.Sauce).SauceID;
            p.CheeseID = CheeseMapper.MapToCheese(pizza.Cheese).CheeseID;
            p.Quantity = pizza.Quantity;
            p.Active   = pizza.Active;

            return(p);
        }