public static AboutUsSectionViewModel GetViewModel(AboutUsSection aboutUsSection, IPageAttachmentUrlRetriever attachmentUrlRetriever) { return(new AboutUsSectionViewModel { Heading = aboutUsSection.Fields.Heading, Text = aboutUsSection.Fields.Text, ImagePath = aboutUsSection.Fields.Image == null ? null : attachmentUrlRetriever.Retrieve(aboutUsSection.Fields.Image).RelativePath }); }
/// <summary> /// Initializes a new instance of the <see cref="AboutUsSectionFields" /> class with the specified content item of type AboutUsSection. /// </summary> /// <param name="instance">The content item of type AboutUsSection that is a target of the extended API.</param> public AboutUsSectionFields(AboutUsSection instance) { mInstance = instance; }