public IViewComponentResult Invoke(AdPosition position) { IAdType ad = null; var positionString = position.ToString(); if (_bunIpConfig.Ad != null) { ad = typeof(Configs.BunIpConfigs.Ad).GetProperty(positionString).GetValue(_bunIpConfig.Ad) as IAdType; } var model = new ViewModel { Ad = ad, Position = position }; return(View(model)); }
/// <summary>Static getter for Ad</summary> public static IPublishedContent GetAd(IAdType that) { return(that.GetPropertyValue <IPublishedContent>("ad")); }