public static string DeleteAttachment(int workItemID, int id) { Dictionary <string, string> result = new Dictionary <string, string>() { { "deleted", "" }, { "id", "" }, { "error", "" } }; bool deleted = false; string errorMsg = string.Empty, ids = string.Empty; try { deleted = WorkloadItem.Attachment_Delete(workItemID: workItemID, attachmentID: id, errorMsg: out errorMsg); } catch (Exception ex) { LogUtility.LogException(ex); errorMsg += ": " + ex.Message; deleted = false; } result["deleted"] = deleted.ToString(); result["id"] = id.ToString(); result["error"] = errorMsg; return(JsonConvert.SerializeObject(result, Formatting.None)); }