예제 #1
0
        public static Item GetItemDetail(GetItemDetailRequest request)
        {
            // If we don't have what we need to make this call, stop here.
            if (request.Configuration == null)
                throw new InvalidRequestException("ExigoService.GetItemDetail() requires an OrderConfiguration.");

            if (request.ItemCode.IsNullOrEmpty())
                throw new InvalidRequestException("ExigoService.GetItemDetail() requires an item code.");

            // Get the item details
            var query   = GetItemsQueryable(request.Configuration, new[] { request.ItemCode }, "Item");
            var apiItem = query.Select(c => c).FirstOrDefault();
            var item    = (ExigoService.Item)apiItem;

            // Populate the group members and dynamic kits
            PopulateAdditionalItemData(new[] { item }, request.Configuration);

            // Return the converted item
            return item;
        }