How can I check 2 classes are added as members of each other.

```
class Team
{
   Driver driver{ get; set;}
   Driver codriver{ get; set;}
}

class Driver
{
   Team parentTeam{ get; set;}
}

```

I have used the following way to get the properties:-

```
PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
foreach (PropertyInfo property in properties)
{
   ////if (!isParent) //need to find this.
   //{
   object propertyValue = property.GetValue(obj);
   if (propertyValue != null)
   {
      // Get the deep clone of the field in the original object and assign the clone to the field in the new object.
      property.SetValue(copiedObject, CloneProcedure(propertyValue));
   }
   //}
}

```

I want to skip through the first class which is a property in second when iterating through 2nd one.
Note: Some of you may feel my classes are declared incorrectly but this is a legacy system and there is no chance of me restructuring the classes.

I have tried DeclaringType and I get property.DeclaringType but obj.GetType().DeclaringType is null.