Skip to content

Instantly share code, notes, and snippets.

@gerhart92
Created Jul 29, 2021
Embed
What would you like to do?
private Family _family;
public virtual Family Family
{
get
{
if (_family != null)
{
return _family;
}
GetItemByQueryOptions builder = new GetItemByQueryOptions();
builder.Query = new Query("/Family");
builder.Lazy = Glass.Mapper.LazyLoading.
builder.RelativeItem = Sitecore.Context.Database.GetItem(new ID(this.Id));
return new RequestContext(new SitecoreService(Sitecore.Context.Database)).SitecoreService.GetItem<Family>(builder);
}
set
{
this._family = value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment