using Core.DomainObjects.PageSections; using WeatherForecast.Models.Abstractions; namespace WeatherForecast.Models.PageSections { public class TitleSectionModel : PageSectionModelBase { public ImageModel? Image { get; set; } public LinkModel? PrimaryLink { get; set; } public LinkModel? SecondaryLink { get; set; } public string? PostedOnBy { get; set; } public TitleSectionModel() { } public TitleSectionModel(TitleSection titleSection) : base(titleSection) { if(titleSection.Image != null) Image = new ImageModel(titleSection.Image); if (titleSection.PrimaryLink != null) PrimaryLink = new LinkModel(titleSection.PrimaryLink); if (titleSection.SecondaryLink != null) PrimaryLink = new LinkModel(titleSection.SecondaryLink); if (titleSection.PostedOnBy != null) PostedOnBy = titleSection.PostedOnBy; } } }