This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ArticleBuilder : BuilderBase | |
{ | |
private ComponentPresentation TridionComponentPresentation { get; set; } | |
public ArticleBuilder(ComponentPresentation componentPresentation) | |
{ | |
TridionComponentPresentation = componentPresentation; | |
} | |
public Article Build() | |
{ | |
var tridionComponent = TridionComponentPresentation.Component; | |
var articleViewModel = new Article | |
{ | |
Title = tridionComponent.Fields["title"].Value, | |
Summary = ResolveRichText(tridionComponent.Fields["short_intro"].Value), | |
RelatedLinks = tridionComponent.Fields["related_links"].Values.ToList() | |
//Etc | |
} | |
//Work magic for XPM | |
MakeInlineEditable(articleViewModel); | |
return articleViewModel; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment