In a project I'm currently using the EF, using the tools included in Visual Studio I generated the POCO-classes for my database. I moved these files to a seperate folder, and in a seperate namespace.
The customizations for these classes are expected to be created in another folder, in its own namespace. (if we follow the project guidelines by the letter)
Which brings me to my question: do partial classes, and their customizations, have to be declared in the same namespace, or could the be spread over 2 seperate namespaces? (in my case x.generated and x.customized)
Partial classes over seperate namespaces
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


VulpesRank #55 · 29.2K reputationPosted May 30, 2012, 5:06 AM EDT
If they're in namespaces with different names, then they'll be treated as separate classes.
So, in other words, the partial classes must have the same fully-qualified names.
Olivier Muhring151 reputationPosted May 31, 2012, 12:48 AM EDT