Skip to content

Instantly share code, notes, and snippets.

@gerhart92
Created July 29, 2021 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerhart92/e9c329c51e566b0181e684b7d68fa407 to your computer and use it in GitHub Desktop.
Save gerhart92/e9c329c51e566b0181e684b7d68fa407 to your computer and use it in GitHub Desktop.
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