Пример #1
0
        public IEnumerable <PageModuleDisplayModelMapperOutput> Map(IEnumerable <PageModuleDisplayModelMapperInput <RichTextWithMediaDataModel> > inputs, WorkFlowStatusQuery workflowStatus)
        {
            foreach (var input in inputs)
            {
                var output = new RichTextWithMediaDisplayModel();
                output.RawHtml = new HtmlString(input.DataModel.RawHtml);

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

                result.Add(item, displayModel);
            }

            return(Task.CompletedTask);
        }
Пример #3
0
        public Task <IEnumerable <PageBlockTypeDisplayModelMapperOutput> > MapAsync(
            IReadOnlyCollection <PageBlockTypeDisplayModelMapperInput <RichTextWithMediaDataModel> > inputCollection,
            PublishStatusQuery publishStatusQuery
            )
        {
            var results = new List <PageBlockTypeDisplayModelMapperOutput>(inputCollection.Count);

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

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

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