Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
private IEnumerable<Family> _families;
public virtual IEnumerable<Family> Families
{
get
{
if (_families != null)
{
return _families;
}
GetItemsByQueryOptions builder = new GetItemsByQueryOptions();
builder.Query = new Query("/Families");
builder.InferType = true;
builder.TemplateId = "{E7A480B9-F931-4D37-AA56-58264A26F49F}";
builder.RelativeItem = Sitecore.Context.Database.GetItem(new ID(this.Id));
return new RequestContext(new SitecoreService(Sitecore.Context.Database)).SitecoreService.GetItems<Family>(builder);
}
set
{
this._families = value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment