In the Query Analyzer I am able to execute the following query which produces my desired result:
select * from /sitecore/content/Home//*[@@templatekey='action' and @Department='{38c76731-f18a-4d29-9d52-33fdb3329881}']
When I attempt the following sitecore query using Glass Mapper in my Department
model I get no results.
[SitecoreQuery("/sitecore/content/Home//*[@@templatekey='action' and @Department='{38c76731-f18a-4d29-9d52-33fdb3329881}']", IsRelative = false)]
public virtual IEnumerable<ActionArticle> TestServices { get; set; }
For testing purposes I've removed and @Department='{38c76731-f18a-4d29-9d52-33fdb3329881}'
from the query above which returns all ActionArticle
s.
Ultimately I'd like to be able to reference the current Department
model within the query. Something along the lines of this:
[SitecoreQuery("/sitecore/content/Home//*[@@templatekey='action' and @Department='"+ this.Id +"']", IsRelative = false)]
public virtual IEnumerable<ActionArticle> TestServices { get; set; }
Of course this
is not available in the above context, so I'm at a loss...
Is this possible and if so how would I go about achieving such a thing?