public static bool IsUmbraco8(this RazorPage view) { #if NETFRAMEWORK return(true); #else return(false); #endif }
public static TService GetService <TService>(this RazorPage view) { #if NETFRAMEWORK return((TService)Current.Factory.GetInstance(typeof(TService))); #else return((TService)view.Context.RequestServices.GetService(typeof(TService))); #endif }
public static T GetSettings <T>(this RazorPage view) where T : class { #if NETFRAMEWORK return(view.GetService <T>()); #else return(view.GetService <IOptions <T> >()?.Value); #endif }
public static Tag A <T>(this System.Web.Mvc.WebViewPage <T> page, string href, string name = "") { return(new Tag("a").Attr("href", href).Name(name)); }
public static JsTag Scr <T>(this System.Web.Mvc.WebViewPage <T> page, string src) { return(new JsTag(src)); }
public static Tag Tag <T>(this System.Web.Mvc.WebViewPage page, string tagName, object attributes = null) { return(new Tag(tagName, attributes)); }