Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Pete 213 posts 285 karma points
    Sep 05, 2013 @ 17:09
    Pete
    0

    umbraco.NodeFactory.Node does not contain a definition for Where

    I've upgraded a 4.7 site to 4.11.9 and it's broke some of my scripts.

    The below comes back with a "umbraco.NodeFactory.Node does not contain a definition for Where" error, in a class file using the code below (I've removed all the misc lines).

    using System;
    using System.Web;
    using WebMatrix.Data;
    using umbraco.NodeFactory;
    using umbraco.BusinessLogic;
    using umbraco.cms.businesslogic.web;
    using umbraco;
    using umbraco.MacroEngines;
    using uComponents.Core.uQueryExtensions;

    var rootNode = uQuery.GetRootNode();
    var searchString = "Homepage";
    var foundNodes = rootNode.GetDescendantNodes().Where(x => x.NodeTypeAlias == searchString).First();
  • Andy Butland 422 posts 2334 karma points MVP 4x hq c-trib
    Sep 05, 2013 @ 22:06
    Andy Butland
    0

    I think you are just missing a 

    using System.Linq;

    line at the top.  Where is an extension methods from that namespace, so you'd need that for it to use it.

    Hope that helps

    Andy

Please Sign in or register to post replies

Write your reply to:

Draft