Exemple #1
0
        public async Task <JToken> Act(
            IEnumerable <BlockConfigInput> config,
            [Service] IFlowActor actor,
            [Service] IFlowContextFactory flowContextFactory)
        {
            var context = flowContextFactory.Create(actor, "<GRAPHQL>");
            await actor.Act(config.Select(o => o.Map()).ToList(), context);

            var obj = await context.AsObject();

            if (obj is JToken jObj)
            {
                return(jObj);
            }
            return(JToken.FromObject(obj));
        }
Exemple #2
0
 public IAsyncEnumerable <object> OnTrigger(
     BlockConfigInput config,
     [Service] IFlowActor flowActor,
     [Service] IFlowContextFactory flowContextFactory)
 => flowActor.GetTrigger(config.Map(), flowContextFactory.Create(flowActor, $"<api subscription>"))
 .ToAsyncEnumerable();