public void RemoveSomething(ISomething2 s) { foreach (var somthing in this.ISomethings.Where(i => i.classB == s)) { somthing.classB = null; } }
public static void run() { ClassSomething some = new ClassSomething(); some.doSomething(); some.Num = 123; ISomething some1 = (ISomething)some; some1.doSomething(); some1.Num = 456; ISomething2 some2 = (ISomething2)some; some2.doSomething2(); }
public void RemoveSomething2(ISomething2 something2) { //iterate through ISomething and remove the ClassB reference }
public void RemoveSomething2(ISomething2 something2) { //iterate through SomethingRelation and remove all the something2 reference }