Exemplo n.º 1
0
        public static ViewCartItem ToViewModel(CartItem model)
        {
            if (model == null)
            {
                return(null);
            }

            ViewCartItem item = new ViewCartItem();


            item.ID          = model.ID;
            item.SellerID    = model.SellerID;
            item.UserID      = model.UserID;
            item.ObjectID    = model.ObjectID;
            item.Type        = model.Type;
            item.Name        = model.Name;
            item.ObjectImage = model.ObjectImage;
            item.Price       = model.Price;
            item.Discount    = model.Discount;
            item.ClassTime   = model.ClassTime;
            item.Number      = model.Number;
            item.Seller_UID  = model.Seller_UID;
            item.User_UID    = model.User_UID;


            return(item);
        }
Exemplo n.º 2
0
        public static CartItem ToEntity(ViewCartItem model)
        {
            CartItem item = new CartItem();

            item.ID          = model.ID;
            item.SellerID    = model.SellerID;
            item.UserID      = model.UserID;
            item.ObjectID    = model.ObjectID;
            item.Type        = model.Type;
            item.Name        = model.Name;
            item.ObjectImage = model.ObjectImage;
            item.Price       = model.Price;
            item.Discount    = model.Discount;
            item.ClassTime   = model.ClassTime;
            item.Number      = model.Number;
            item.Seller_UID  = model.Seller_UID;
            item.User_UID    = model.User_UID;


            return(item);
        }