private void SetupForm() { if (Detached) { return; } bool containersNull = AnyContainersNull(entity); if (containersNull || entity.EntitySet.MappingSet.Database == null) { form.SetAvailableTables(new List <ITable>()); } else { form.SetAvailableTables(entity.EntitySet.MappingSet.Database.Tables); } if (!containersNull) { form.SetAvailableEntities(entity.EntitySet.Entities.Where(en => en != entity)); } form.SetProperties(entity.ConcreteProperties); form.EntityName = entity.Name; form.Mappings = entity.Mappings(); form.Discriminator = entity.Discriminator; form.ParentEntity = entity.Parent; form.SetChildEntities(entity.Children); form.SetVirtualProperties(entity.Ex); }