/// <inheritdoc /> public override async ItemExecutionPromise Render(IByteCounterStream outputStream, ContextObject context, ScopeData scopeData) { await CoreAction(outputStream, context, scopeData, async (stream, o, data) => { await MorestachioDocument.ProcessItemsAndChildren(Children, outputStream, o, scopeData); }); return(new DocumentItemExecution[0]); }
/// <exception cref="IndexedParseException"></exception> /// <inheritdoc /> public override async ItemExecutionPromise Render(IByteCounterStream outputStream, ContextObject context, ScopeData scopeData) { var contexts = new List <DocumentItemExecution>(); await CoreAction(outputStream, await MorestachioExpression.GetValue(context, scopeData) , scopeData, async itemContext => { await MorestachioDocument.ProcessItemsAndChildren(Children, outputStream, itemContext, scopeData); //contexts.AddRange(Children.WithScope(itemContext)); }); return(contexts); }
/// <inheritdoc /> public override async ItemExecutionPromise Render(IByteCounterStream outputStream, ContextObject context, ScopeData scopeData) { var index = 0; var collectionContext = new ContextCollection(index, false, context.Key, context.Parent, context.Value); while (ContinueBuilding(outputStream, scopeData) && (await MorestachioExpression.GetValue(collectionContext, scopeData)).Exists()) { //TODO get a way how to execute this on the caller await MorestachioDocument.ProcessItemsAndChildren(Children, outputStream, collectionContext, scopeData); collectionContext = new ContextCollection(++index, false, context.Key, context.Parent, context.Value); } return(Enumerable.Empty <DocumentItemExecution>()); }
/// <inheritdoc /> public override async ItemExecutionPromise Render(IByteCounterStream outputStream, ContextObject context, ScopeData scopeData) { var index = 0; while (ContinueBuilding(outputStream, context)) { var collectionContext = new ContextCollection(index++, false, context.Options, context.Key, context.Parent, context.Value); //TODO get a way how to execute this on the caller await MorestachioDocument.ProcessItemsAndChildren(Children, outputStream, collectionContext, scopeData); if (!(await MorestachioExpression.GetValue(collectionContext, scopeData)).Exists()) { break; } } return(new DocumentItemExecution[0]); }