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); })); }
public AdaptedStreamedCommandContext(IStreamedCommandContext <Any> @delegate, IResolvedType serviceMethodOutputType) { Delegate = @delegate; ServiceMethodOutputType = serviceMethodOutputType; }