SiteCriterion for global site

Magnus Rahl
Member since: 2008
How do I write a SiteCriterion to get entities only from the global/null site (not including specific sites)?
#26769 Dec 19, 2008 9:21

    Hi Magnus,

    It's not directly built into the criterion, but it is possible to achieve this by subclassing SiteCriterion and overriding its GetQuery(string propertyName) method. I.e:

    public override string GetQuery(string propertyName)
      return propertyName + " IS NULL";

    #27244 Jan 21, 2009 21:53