public virtual async Task <IActionResult> GetCartDetails(ShoppingCartItemSearchModel searchModel) { if (!await _permissionService.AuthorizeAsync(StandardPermissionProvider.ManageCurrentCarts)) { return(await AccessDeniedDataTablesJson()); } //try to get a customer with the specified id var customer = await _customerService.GetCustomerByIdAsync(searchModel.CustomerId) ?? throw new ArgumentException("No customer found with the specified id"); //prepare model var model = await _shoppingCartModelFactory.PrepareShoppingCartItemListModelAsync(searchModel, customer); return(Json(model)); }