Search code examples
c#.netpartial-classes

Multiple partial classes with a single namespace returning error


I've declared a partial class with name "BusinessLayer" in BL namespace, but now I want to add another class with same name, and with keyword "partial" in that namespace. But Whenever I try to add class with with name "BusinessLayer", I'm getting an error, saying I can't declared multiple classes with same name in a namespace. Then how can I use partial classes in a single namespace?


Solution

  • I would fix your code if you'd write some, even just as an example.

    Anyway, you should tag both as "partial".
    Any declaration of this class, anywhere, should have the "partial" keyword in order to allow it to compile properly.