public List <BlockAdapt> GetBlocks(ArticleAdapt parent, List <Block> inputBlocks) { return(inputBlocks.Select(m => new BlockAdapt() { Components = m.Components.Cast <IBaseComponent>().ToList(), Id = m.System.Id, ParentId = parent.Id, Body = m.Body, Title = m.Title, DisplayTitle = m.DisplayTitle, TrackingId = m.System.Id }).ToList()); }
public List <BlockAdapt> GetBlocks(ArticleAdapt parent, List <Block> inputBlocks, ref int trackingId) { var blocks = new List <BlockAdapt>(); foreach (var inputBlock in inputBlocks) { trackingId++; blocks.Add( new BlockAdapt() { Components = inputBlock.MappedComponents.ToList(), Id = inputBlock.System.Id, ParentId = parent.Id, Body = inputBlock.Body, Title = inputBlock.Title, DisplayTitle = inputBlock.DisplayTitle, TrackingId = trackingId }); } return(blocks); }