Beispiel #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);
        }
Beispiel #2
0
        public static CheeseToppingDAO MapToCheeseToppingDAO(CheeseTopping cheeseTopping)
        {
            var ct = new CheeseToppingDAO();

            ct.Id     = cheeseTopping.CheeseToppingID;
            ct.Pizza  = PizzaMapper.MapToPizzaDAO(cheeseTopping.Pizza);
            ct.Cheese = CheeseMapper.MapToCheeseDAO(cheeseTopping.Cheese);
            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);
        }
        public static PizzaDAO MapToPizzaDAO(Pizza pizza)
        {
            var p = new PizzaDAO();

            p.Id       = pizza.PizzaID;
            p.Size     = SizeMapper.MapToSizeDAO(pizza.Size);
            p.Crust    = CrustMapper.MapToCrustDAO(pizza.Crust);
            p.Sauce    = SauceMapper.MapToSauceDAO(pizza.Sauce);
            p.Cheese   = CheeseMapper.MapToCheeseDAO(pizza.Cheese);
            p.Quantity = pizza.Quantity;
            p.Active   = pizza.Active;

            return(p);
        }