public JsonResult GetContentOfShoppingCart(int userId) { var orderForCurrentUser = m_facade.GetOrderByUserId(userId); if (orderForCurrentUser == null) { m_facade.AddOrder(new Order(0, userId, null)); orderForCurrentUser = m_facade.GetOrderByUserId(userId); } if (orderForCurrentUser == null) { return(Json(new { success = false }, JsonRequestBehavior.AllowGet)); } return(Json(orderForCurrentUser, JsonRequestBehavior.AllowGet)); }