最佳答案
Can I create partial class in different namespaces? Will it work correct? e.x.:
class1.cs
namespace name1
{
public partial class Foo
{
Bar1(){
return 10;
}
}
}
class2.cs
namespace name1.name2
{
public partial class Foo
{
Bar2(){
return 100;
}
}
}
main.cs
using name1;
using name1.name2;
namespace mainClass
{
public class mainClass
{
Foo classFoo = new Foo();
int Count = classFoo.Bar1() + classFoo.Bar2();
// Will Count = 110?
}
}
What should I do to make it work? (if my example not correct)