Example #1
0
    public ActionResult Index()
    {
        IUmbracoContext        umbracoContext = _umbracoContextAccessor.GetRequiredUmbracoContext();
        IPublishedContentCache?store          = umbracoContext.Content;

        if (store?.HasContent() ?? false)
        {
            // If there is actually content, go to the root.
            return(Redirect("~/"));
        }

        var model = new NoNodesViewModel {
            UmbracoPath = _hostingEnvironment.ToAbsolute(_globalSettings.UmbracoPath)
        };

        return(View(_globalSettings.NoNodesViewPath, model));
    }
Example #2
0
 public void Has_Content()
 {
     Assert.IsTrue(_cache.HasContent());
 }