Exemplo n.º 1
0
        private async Task ExecuteNotifications(HttpContext httpContext, string notificationName)
        {
            var notificationGuid = Guid.NewGuid();

            if (_registry.TryGetValue(notificationName, out var handlersTypeInformation))
            {
                httpContext.Request.
            }
        }
Exemplo n.º 2
0
        private async Task ExecuteNotifications(HttpContext httpContext, string notificationName,
                                                Guid notificationId)
        {
            if (_registry.TryGetValue(notificationName, out var handlersTypeInformation))
            {
                var cancellationToken = httpContext.RequestAborted;
                var notification      = await httpContext.Request.BodyReader.DeserializeBodyAsync(
                    handlersTypeInformation.notificationType,
                    _jsonSerializerOptions,
                    cancellationToken);

                Task.WaitAll(
                    handlersTypeInformation.notificationHandlerTypes
                    .Select(notificationHandlerType =>
                            notificationHandlerType.HandleNotification(
                                notification,
                                notificationId,
                                httpContext.RequestServices,
                                cancellationToken))
                    .ToArray(),
                    cancellationToken);
            }
        }