public ComponentCart Post(ComponentCartDTO value) { ComponentCart model = new ComponentCart() { ComponentId = value.ComponentId, ShoppingCartId = value.ShoppingCartId }; return(IComponentCartRepository.Create(model)); }
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)); }