I am working on some legacy code and have come across something that I\'m not sure of. We have a class y
that is declared inside of another class x
.
You could still refactor your class y into another file, but use a parial class. The benefit of this is that you still have one class per file and don't have the refactoring hassles of moving the declaration outside of class x.
e.g. you could have a code file: x.y.cs which would look something like
partial class X
{
class Y
{
//implementation goes here
}
}