Ejemplo n.º 1
0
        public static Task InvokeCommand <TCommand>(this INybusBridge bridge, TCommand command) where TCommand : class, ICommand
        {
            if (command == null)
            {
                throw new ArgumentNullException(nameof(command));
            }

            var correlationId = Guid.NewGuid();

            return(bridge.InvokeCommand(command, correlationId));
        }
Ejemplo n.º 2
0
        public static Task RaiseEvent <TEvent>(this INybusBridge bridge, TEvent @event) where TEvent : class, IEvent
        {
            if (@event == null)
            {
                throw new ArgumentNullException(nameof(@event));
            }

            var correlationId = Guid.NewGuid();

            return(bridge.RaiseEvent(@event, correlationId));
        }