如何在C#中配置自己的WebHook接收器配置?

时间:2019-04-22 05:38:58

标签: c# asp.net-webhooks

我需要在WebHookReceiverConfig类中重写GetReceiverConfigAsync方法。它在构造函数中要求2个参数,但不知道如何处理。 我该如何实现?

    public class MyWebHookHandler : WebHookHandler
    {
        public MyWebHookHandler()
        {
            this.Receiver = "genericjson";
        }

        public override Task ExecuteAsync(string generator, WebHookHandlerContext context)
        {
            var data = context.GetDataOrDefault<object>();
            return Task.FromResult(true);
        }
    }
    public class CustomWHReceiver : WebHookReceiverConfig
    {
        public override System.Threading.Tasks.Task<string> GetReceiverConfigAsync(string name, string id)
        {
            //Code goes here
        }
    }

0 个答案:

没有答案