示例#1
0
        public IEnumerable <PageModuleDisplayModelMapperOutput> Map(IEnumerable <PageModuleDisplayModelMapperInput <RawHtmlDataModel> > inputs, WorkFlowStatusQuery workflowStatus)
        {
            foreach (var input in inputs)
            {
                var output = new RawHtmlDisplayModel();
                output.RawHtml = new HtmlString(input.DataModel.RawHtml);

                yield return(input.CreateOutput(output));
            }
        }
        public Task MapAsync(
            PageBlockTypeDisplayModelMapperContext <RawHtmlDataModel> context,
            PageBlockTypeDisplayModelMapperResult <RawHtmlDataModel> result
            )
        {
            foreach (var item in context.Items)
            {
                var displayModel = new RawHtmlDisplayModel();
                displayModel.RawHtml = new HtmlString(item.DataModel.RawHtml);

                result.Add(item, displayModel);
            }

            return(Task.CompletedTask);
        }
示例#3
0
        public Task <IEnumerable <PageBlockTypeDisplayModelMapperOutput> > MapAsync(
            IReadOnlyCollection <PageBlockTypeDisplayModelMapperInput <RawHtmlDataModel> > inputCollection,
            PublishStatusQuery publishStatusQuery
            )
        {
            var results = new List <PageBlockTypeDisplayModelMapperOutput>(inputCollection.Count);

            foreach (var input in inputCollection)
            {
                var output = new RawHtmlDisplayModel();
                output.RawHtml = new HtmlString(input.DataModel.RawHtml);

                results.Add(input.CreateOutput(output));
            }

            return(Task.FromResult(results.AsEnumerable()));
        }