In the past I have avoided defining nested classes. But if a class is only ever going to be used inside the primary-class, then is nesting the class the ideal place for it? Are there any accepted conventions on this subject?
public class PrimaryClass
{
public class SubClass
{
// ...
}
public SubClass MySubClass { get; set; }
// ...
}
Or should it always be
public class SubClass
{
// ...
}
public class PrimaryClass
{
public SubClass MySubClass { get; set; }
// ...
}