public IDtoBase GetLink(DtoLink link) { if (!(this.Links[link].IsLoaded)) { try { // get... var value = this.GetValue <long>(link.ReferenceField); if (value != 0) { var persistence = link.Link.ParentEntityType.Persistence; var parent = (IDtoCapable)persistence.GetById(new object[] { value }, OnNotFound.ReturnNull); // set... if (parent != null) { this.Links[link].Dto = parent.ToDto(); } } } finally { this.Links[link].IsLoaded = true; } } // return... return(this.Links[link].Dto); }
public bool IsLoaded(DtoLink link) { return(this.Links[link].IsLoaded); }
public void SetLink(DtoLink link, IDtoBase dto) { this.Links[link].Dto = dto; }