
using Core.Abstractions.DomainObjects;
using Core.Abstractions.Models;
using Core.DomainObjects;
using Core.DomainObjects.PageSections;
using WeatherForecast.Models.PageSections;

namespace WeatherForecast.Models.Abstractions {

  /// <summary>
  /// 
  /// </summary>
  /// <typeparam name="T"></typeparam>
  public abstract class PageModelBase<T> : ModelBase {

    /// <summary>
    /// 
    /// </summary>
    public HeaderModel Header { get; set; }

    /// <summary>
    /// 
    /// </summary>
    public TitleSectionModel? TitleSection { get; set; }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="pageBase"></param>
    public PageModelBase(PageBase<T> pageBase) {
      if(pageBase.TitleSection !=null)
        TitleSection = new TitleSectionModel(pageBase.TitleSection);

      Header = new HeaderModel(pageBase.Header);
    }
  }
}
