親オブジェクト内の childObject の参照を削除するには、リフレクションを使用する必要があります。
public class ParentObject{
public object ChildObject {get;set;}
}
/* Implementation */
ParentObject parentObject = new ParentObject();
object childObject = new Object();
//I set this using reflection (PropertyInfo SetValue operation)
parentObject.ChildObject = childObject ;
...
//I want to remove the reference to the child object using reflection
RemoveObjectUsingReflection(parentObject, childObject);
Assert.IsNull(parentObject.ChildObject); //returns true
function RemoveObjectUsingReflection(object parentObject, object childObject)
{
//Appreciate your help here
}