public IEnumerable <WorkflowQueue> Get(string status) { try { if (!(Enum.TryParse(status, out QueueItemStatusType queueItemStatusType))) { return(null); } WorkflowQueueService _workflowQueueService = new WorkflowQueueService(); List <WorkflowQueue> list = _workflowQueueService.List(queueItemStatusType); return(Enumerable.Range(1, list.Count - 1).Select(i => new WorkflowQueue { Id = list[i].Id, RequestBody = list[i].RequestBody, UtcDateTime = list[i].UtcDateTime, Response = list[i].Response, Status = list[i].Status })); } catch (Exception ex) { throw ex; } }
public IEnumerable <WorkflowQueueRequest> Get() { try { WorkflowQueueService _workflowQueueService = new WorkflowQueueService(); List <WorkflowQueue> list = _workflowQueueService.List().AsEnumerable() .OrderByDescending(d => d.Id) .ToList(); return(Enumerable.Range(1, list.Count - 1).Select(i => new WorkflowQueueRequest { Id = list[i].Id, RequestBody = list[i].RequestBody, UtcDateTime = list[i].UtcDateTime, Response = list[i].Response, Status = list[i].Status, WFlowRID = JObject.Parse(list[i].RequestBody).ToObject <SapphireWorkflowRequestObject>().WFlowRID, RefObjRID = JObject.Parse(list[i].RequestBody).ToObject <SapphireWorkflowRequestObject>().RefObjRID })); } catch (Exception ex) { throw ex; } }