Ejemplo n.º 1
0
        public Option <Any> HandleStreamedCommand(Any command, IStreamedCommandContext <Any> context)
        {
            return(Unwrap(() =>
            {
                if (!StreamedCommandHandlers.TryGetValue(context.CommandName, out var handler))
                {
                    throw new InvalidOperationException(
                        $"No streamed command handler found for command [{context.CommandName}] on CRDT entity: {EntityClass}");
                }

                var adaptedContext = new AdaptedStreamedCommandContext(context, handler.ServiceMethod.OutputType);
                return handler.Invoke(Entity, command, adaptedContext);
            }));
        }
Ejemplo n.º 2
0
 public AdaptedStreamedCommandContext(IStreamedCommandContext <Any> @delegate, IResolvedType serviceMethodOutputType)
 {
     Delegate = @delegate;
     ServiceMethodOutputType = serviceMethodOutputType;
 }