Ejemplo n.º 1
0
        public static AssetsHelper GetInstance(HtmlHelper htmlHelper)
        {
            AssetsHelper toReturn = null;

            var instanceKey = "AssetsHelperInstance";

            var context = htmlHelper.ViewContext.HttpContext;

            if (context != null)
            {
                toReturn = (AssetsHelper)context.Items[instanceKey];

                if (toReturn == null)
                {
                    context.Items.Add(instanceKey, toReturn = new AssetsHelper());
                }
            }

            return(toReturn);
        }
Ejemplo n.º 2
0
 public static AssetsHelper Assets(this HtmlHelper htmlHelper)
 {
     return(AssetsHelper.GetInstance(htmlHelper));
 }