/// <summary> /// Method to get the inventory lists /// </summary> /// <param name="logicalDeviceId"></param> /// <param name="pageIndex"></param> /// <param name="pageSize"></param> /// <param name="sortField"></param> /// <param name="sortDirection"></param> /// <returns></returns> public JsonResult GetDeviceInventoriesList(string logicalDeviceId, int pageIndex, int pageSize, string sortField, string sortDirection) { DeviceModel deviceModel; using (JetstreamClient objMainServiceClient = new JetstreamClient()) { deviceModel = objMainServiceClient.GetDeviceInventoriesList(logicalDeviceId); SortingPagingInfo info = new SortingPagingInfo { SortField = sortField, SortDirection = sortDirection, }; deviceModel.Inventories = ApplySortingInventory(info, deviceModel.Inventories).Skip(pageIndex * pageSize).Take(pageSize).ToList(); } return Json(new { deviceModel }, JsonRequestBehavior.AllowGet); }