From 7b77e7a8b7e13e3b37ff45a1149bacf72651fd24 Mon Sep 17 00:00:00 2001
From: ecfan <Esther.Fan@microsoft.com>
Date: Tue, 23 May 2017 15:21:31 -0700
Subject: [PATCH 1/2] Clarify comments

---
 .../Controllers/PollTriggerController.cs      | 27 +++++++++----------
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/LogicAppTriggers/Controllers/PollTriggerController.cs b/LogicAppTriggers/Controllers/PollTriggerController.cs
index 15e50a2..3c50e22 100644
--- a/LogicAppTriggers/Controllers/PollTriggerController.cs
+++ b/LogicAppTriggers/Controllers/PollTriggerController.cs
@@ -9,30 +9,30 @@ namespace LogicAppTriggers.Controllers
     public class PollTriggerController : ApiController
     {
         /// <summary>
-        /// Sample polling trigger that will fire whenever the last time it fired was more than 2 minutes ago.
+        /// Create a sample polling trigger that fires whenever the last time the trigger fired was more than 2 minutes ago.
         /// </summary>
         /// <param name="triggerState"></param>
         /// <returns></returns>
         public HttpResponseMessage Get(string triggerState = "")
         {
-            //If there is no triggerState - meaning this is the first poll.
+            // If "triggerState" doesn't exist, then this iteration is the first poll.
             if(String.IsNullOrEmpty(triggerState))
             {
-                ///
-                /// Generate the triggerState.  This will be the identifier you will use to know which items you have triggered off of.
-                /// This is commonly a "timestamp", and you would check on each poll if there are any items available after the timestamp.
-                ///
+                /// Generate the "triggerState" value, commonly a "timestamp", 
+                /// to identify which items caused the trigger to fire. 
+                /// On each poll, check for any new items became available after the timestamp.
                 triggerState = DateTime.UtcNow.ToString();
                 return GenerateAsyncResponse(HttpStatusCode.Accepted, triggerState, "15");
             }
-            //If there is a triggerState - meaning we have polled before and returned a location header in the if branch above.
+            // If "triggerState" exists, then the trigger was fired before 
+            // and returned a "location" header from the previous "if" branch.
             else
             {
-                //Do some work to check if a trigger is available
+                // Check whether "triggerState" exists. 
                 if(DateTime.Parse(triggerState) < DateTime.UtcNow)
                 {
-                    //If available, return a 200 - can update the triggerState as well.
-                    //In this case I'm going to update the triggerState so that it will fire again in 2 minutes based on this fake logic.
+                    // If "triggerState exists, return a "200 OK" status. You can also update "triggerState".
+                    // This example updates "triggerState" so that the trigger fires again in 2 minutes based on this fake logic.
                     triggerState = DateTime.UtcNow.AddMinutes(2).ToString();
                     return GenerateAsyncResponse(HttpStatusCode.OK, triggerState, "15");
                 }
@@ -41,14 +41,13 @@ public HttpResponseMessage Get(string triggerState = "")
                     return GenerateAsyncResponse(HttpStatusCode.Accepted, triggerState, "15");
                 }
             }
-
         }
 
         private HttpResponseMessage GenerateAsyncResponse(HttpStatusCode code, string triggerState, string retryAfter)
         {
-            HttpResponseMessage responseMessage = Request.CreateResponse(code); //Return a 200 to tell it to fire.
-            responseMessage.Headers.Add("location", String.Format("{0}://{1}/api/polltrigger?triggerState={2}", Request.RequestUri.Scheme, Request.RequestUri.Host, HttpUtility.UrlEncode(triggerState)));  //Where the engine will poll to check status
-            responseMessage.Headers.Add("retry-after", retryAfter);   //How many seconds it should wait.  If multiple files are available you can return a 0 here and the engine will immediately come back and grab other triggers.
+            HttpResponseMessage responseMessage = Request.CreateResponse(code); // Return a "200 OK" status to fire the trigger.
+            responseMessage.Headers.Add("location", String.Format("{0}://{1}/api/polltrigger?triggerState={2}", Request.RequestUri.Scheme, Request.RequestUri.Host, HttpUtility.UrlEncode(triggerState))); // The URL that the engine polls to check status
+            responseMessage.Headers.Add("retry-after", retryAfter); // The number of seconds the engine should wait before polling again. If multiple files are found, you can return "0" seconds so that the engine immediately returns for more items.
             return responseMessage;
         }
     }

From 9c4e8beaed8e6ce1b97285fb34aa624491257244 Mon Sep 17 00:00:00 2001
From: ecfan <Esther.Fan@microsoft.com>
Date: Tue, 23 May 2017 15:34:39 -0700
Subject: [PATCH 2/2] Clarify comments

---
 .../Controllers/WebhookTriggerController.cs            | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/LogicAppTriggers/Controllers/WebhookTriggerController.cs b/LogicAppTriggers/Controllers/WebhookTriggerController.cs
index ebe49cd..938acf0 100644
--- a/LogicAppTriggers/Controllers/WebhookTriggerController.cs
+++ b/LogicAppTriggers/Controllers/WebhookTriggerController.cs
@@ -13,10 +13,11 @@ namespace LogicAppTriggers.Controllers
     public class WebhookTriggerController : ApiController
     {
         public static List<string> subscriptions = new List<string>();
+
         /// <summary>
-        /// Recieve a subscription to a webhook.  
+        /// Receive subscription to webhook.
         /// </summary>
-        /// <param name="callbackUrl">URL to get from Logic Apps - @listCallbackUrl()</param>
+        /// <param name="callbackUrl">The callback URL to get from the Logic Apps engine - @listCallbackUrl()</param>
         /// <returns></returns>
         [HttpPost, Route("api/webhooktrigger/subscribe")]
         public HttpResponseMessage Subscribe([FromBody] string callbackUrl)
@@ -25,9 +26,8 @@ public HttpResponseMessage Subscribe([FromBody] string callbackUrl)
             return Request.CreateResponse();
         }
 
-
         /// <summary>
-        /// Fire all triggers - do a GET to this API to fire all triggers subscribed
+        /// Fire all triggers. To fire all subscribed triggers, perform a GET to this API.
         /// </summary>
         /// <returns></returns>
         [HttpGet, Route("api/webhooktrigger/trigger")]
@@ -41,7 +41,7 @@ public async Task<HttpResponseMessage> Get()
             return Request.CreateResponse(HttpStatusCode.Accepted, String.Format("There are {0} subscriptions fired", subscriptions.Count));
         }
         /// <summary>
-        /// Unsubscribe
+        /// Unsubscribe from webhook.
         /// </summary>
         /// <param name="callbackUrl"></param>
         /// <returns></returns>