Esempio n. 1
0
        public ComponentCart Post(ComponentCartDTO value)
        {
            ComponentCart model = new ComponentCart()
            {
                ComponentId    = value.ComponentId,
                ShoppingCartId = value.ShoppingCartId
            };

            return(IComponentCartRepository.Create(model));
        }
Esempio n. 2
0
        public ComponentCart Put(int id, ComponentCartDTO value)
        {
            ComponentCart model = IComponentCartRepository.Get(id);

            if (value.ComponentId != 0)
            {
                model.ComponentId = value.ComponentId;
            }
            if (value.ShoppingCartId != 0)
            {
                model.ShoppingCartId = value.ShoppingCartId;
            }
            return(IComponentCartRepository.Update(model));
        }