Answers for "webhook C#"

C#
0

webhook C#

public class DefaultHookHandler : WebHookHandler
{
	public override Task ExecuteAsync(string receiver, WebHookHandlerContext context)
	{
		// Get data from WebHook
		CustomNotifications data = context.GetDataOrDefault<CustomNotifications>();

		// 如果這裡會處理太久的話,建議將資料放到 Queue 之中慢慢處理,先回傳 true 
		//https://docs.asp.net/projects/webhooks/en/latest/receiving/handlers.html
		// Get data from each notification in this WebHook
		foreach (IDictionary<string, object> notification in data.Notifications)
		{
			var action = notification["Action"];
			JObject product = (JObject)notification["Product"];
		}
		return Task.FromResult(true);
	}
}
Posted by: Guest on March-25-2021

C# Answers by Framework

Browse Popular Code Answers by Language