Created
July 29, 2021 10:47
-
-
Save gerhart92/dc7d6b51acbca51ff841a53106a8102d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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