Is there a way to make C# inner class instances specific to the instance of the outer class. For example, is there way to do something like
public class Group
{
public class Generator
{
}
}
Group Group1=new Group()
Group Group2=new Group()
Group1.Generator Generator1=new Group1.Generator();
Group2.Generator Generator2=new Group2.Generator();
and have Generator1 and Generator2 be of different types?
For context, I am trying to write a group theory project where generators only make sense in their parent group, and I was hoping to avoid passing around explicit references to parent groups and checks to ensure parent objects are equal.