reactredux/webapi/WeatherForecast/Models/Responses/ContentResponseModel.cs

136 lines
3.4 KiB
C#

using Core.Abstractions.Models;
using Core.DomainObjects.Documents;
using WeatherForecast.Models.Pages;
namespace WeatherForecast.Models.Responses {
/// <summary>
///
/// </summary>
public class ContentResponseModel : ResponseModelBase {
/// <summary>
///
/// </summary>
public string SiteName { get; set; }
/// <summary>
///
/// </summary>
public string SiteUrl { get; set; }
/// <summary>
///
/// </summary>
public HeaderModel Header { get; set; }
/// <summary>
///
/// </summary>
public LocalizationModel Localization { get; set; }
/// <summary>
///
/// </summary>
public List<RouteModel> Routes { get; set; }
/// <summary>
///
/// </summary>
public List<RouteModel> AdminRoutes { get; set; }
/// <summary>
///
/// </summary>
public List<RouteModel> ServiceRoutes { get; set; }
/// <summary>
///
/// </summary>
public List<MenuItemModel> TopMenu { get; set; }
/// <summary>
///
/// </summary>
public List<MenuItemModel> SideMenu { get; set; }
/// <summary>
/// Home page static front end content
/// </summary>
public HomePageModel HomePage { get; set; }
/// <summary>
/// Shop catalog page static front end content
/// </summary>
public ShopCatalogPageModel ShopCatalog { get; set; }
/// <summary>
/// Shop item page static front end content
/// </summary>
public ShopItemPageModel ShopItem { get; set; }
/// <summary>
///
/// </summary>
public ShopCartPageModel ShopCart { get; set; }
/// <summary>
///
/// </summary>
public ShopCheckoutPageModel ShopCheckout { get; set; }
/// <summary>
///
/// </summary>
public BlogCatalogPageModel BlogCatalog { get; set; }
/// <summary>
///
/// </summary>
public BlogItemPageModel BlogItem { get; set; }
/// <summary>
///
/// </summary>
public SignInPageModel SignIn { get; set; }
/// <summary>
///
/// </summary>
public SignUpPageModel SignUp { get; set; }
/// <summary>
///
/// </summary>
/// <param name="domainObject"></param>
public ContentResponseModel(Content domainObject) {
SiteName = domainObject.SiteName;
SiteUrl = domainObject.SiteUrl;
Header = new HeaderModel(domainObject.Header);
Localization = new LocalizationModel(domainObject.Localization);
Routes = domainObject.Routes.Select(x => new RouteModel(x)).ToList();
AdminRoutes = domainObject.AdminRoutes.Select(x => new RouteModel(x)).ToList();
ServiceRoutes = domainObject.ServiceRoutes.Select(x => new RouteModel(x)).ToList();
TopMenu = domainObject.TopMenu.Select(x => new MenuItemModel(x)).ToList();
SideMenu = domainObject.SideMenu.Select(x => new MenuItemModel(x)).ToList();
HomePage = new HomePageModel(domainObject.HomePage);
ShopCatalog = new ShopCatalogPageModel(domainObject.ShopCatalog);
ShopItem = new ShopItemPageModel(domainObject.ShopItem);
ShopCart = new ShopCartPageModel(domainObject.ShopCart);
ShopCheckout = new ShopCheckoutPageModel(domainObject.ShopCheckout);
BlogCatalog = new BlogCatalogPageModel(domainObject.BlogCatalog);
BlogItem = new BlogItemPageModel(domainObject.BlogItem);
SignIn = new SignInPageModel(domainObject.SignIn);
SignUp = new SignUpPageModel(domainObject.SignUp);
}
}
}