public static NewsBlock CreateNewsBlock(string title, List <NewsContent> newsContents = null) { var newsBlock = new NewsBlock(title); newsBlock.Set(NewsBlock.PropertyAccessExpressions.NewsContents, newsContents); return(newsBlock); }
public static NewsBlock CreateNewsBlock(string title, params string[] details) { var newsContents = details.Select((detail, i) => CreateNewsContent(i + 1, detail)).ToList(); var newsBlock = new NewsBlock(title); newsBlock.Set(NewsBlock.PropertyAccessExpressions.NewsContents, newsContents); return(newsBlock); }