示例#1
0
 /// <summary>
 /// Регистрация обработчика
 /// </summary>
 public async Task RegisterHooks(UserWebHook @userWebHook)
 {
     await Task.Run(() => _repository.GetConnection(c =>
                                                    c.Execute(@"Hooks.RegisterHooks_Ins", new
     {
         @userWebHook.UserId,
         @userWebHook.EndpointRequest,
         @userWebHook.Payload,
         @userWebHook.EventName
     }, commandType: CommandType.StoredProcedure)));
 }
            /// <summary>
            /// Добавление произвольного числа продуктов
            /// </summary>
            public async Task <Unit> Handle(RegisterHooks.Command request, CancellationToken cancellationToken)
            {
                var hook = new UserWebHook
                {
                    UserId          = request.UserId,
                    EndpointRequest = request.EndpointRequest,
                    EventName       = request.EventName,
                    Payload         = request.Payload
                };

                await _webHookService.RegisterHooks(hook);

                return(Unit.Value);
            }