private void DeepSearchRecur_Instance(Entity entity) { var values = entity.GetNonDefaultPropertyValues(); foreach (var value in values) { var mp = value.Property as IProperty; switch (mp.Category) { case PropertyCategory.ReferenceEntity: if (mp.GetMeta(entity).Serializable) { var refEntity = entity.GetRefEntity(mp as IRefEntityProperty); AddEntityType(refEntity.GetType()); DeepSearchRecur_Instance(refEntity); } break; case PropertyCategory.List: if (mp.GetMeta(entity).Serializable) { var list = entity.GetLazyList(mp as IListProperty); for (int i = 0, c = list.Count; i < c; i++) { var child = list[i]; if (i == 0) { AddEntityType(child.GetType()); } DeepSearchRecur_Instance(child); } } break; default: break; } } }