public HttpResponseMessage CheckProcess(HttpRequestMessage request, [FromBody] int[] processIds) { return(GetHttpResponse(request, () => { var message = string.Empty; ProcessTriggerData[] processTriggers = _ExtractionProcessService.GetProcessTriggerByRunDate().Where(c => processIds.Contains(c.ProcessId) && (c.Status == PackageStatus.New || c.Status == PackageStatus.Pending || c.Status == PackageStatus.Running)).ToArray(); if (processTriggers.Count() > 0) { foreach (var trigger in processTriggers) { //if (trigger.Status == PackageStatus.Done) // message += "The process template for " + trigger.ProcessTitle + " has be completed.<br>"; //else if (trigger.Status == PackageStatus.New) { message += "The process template for " + trigger.ProcessTitle + " has been added for processing.<br>"; } else if (trigger.Status == PackageStatus.Pending) { message += "The process template for " + trigger.ProcessTitle + " is still pending for processing.<br>"; } else if (trigger.Status == PackageStatus.Running) { message += "The process template for " + trigger.ProcessTitle + " is currently running.<br>"; } } } else { message = "Ok"; } return request.CreateResponse <string>(HttpStatusCode.OK, message); })); }