Last active
August 29, 2015 14:05
-
-
Save ArveSystad/df06cec5b0f60e6e9fa6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public Cart GetShoppingCart(int orderGroupId) | |
| { | |
| var parameters = new OrderSearchParameters | |
| { | |
| SqlWhereClause = "OrderGroupId = " + orderGroupId | |
| }; | |
| var options = new OrderSearchOptions | |
| { | |
| Classes = new StringCollection { "ShoppingCart" }, | |
| RecordsToRetrieve = 1 | |
| }; | |
| var findCarts = OrderContext.Current.FindCarts(parameters, options); | |
| Cart cart = findCarts.FirstOrDefault(); | |
| if (cart == null) | |
| throw new Exception("Can't find order! Something has clearly gone wrong"); | |
| return cart; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment