public static cart_keys Update(int article_id, int quantity) { if (quantity < 1) { return((cart_keys)null); } List <cart_keys> cart = ShopCart.GetCart(); if (cart != null) { cart_keys cartKeys = cart.Find((Predicate <cart_keys>)(p => p.article_id == article_id)); if (cartKeys != null) { int index = cart.FindIndex((Predicate <cart_keys>)(p => p.article_id == article_id)); cartKeys.quantity = quantity; cart[index] = cartKeys; ShopCart.AddCookies(JsonHelper.ObjectToJSON((object)cart)); return(cartKeys); } } return((cart_keys)null); }