Example #1
0
        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);
        }
Example #2
0
 public bool IsLoaded(DtoLink link)
 {
     return(this.Links[link].IsLoaded);
 }
Example #3
0
 public void SetLink(DtoLink link, IDtoBase dto)
 {
     this.Links[link].Dto = dto;
 }