Resolving the Conflict of definitions in same namespaces

前端 未结 3 416
醉酒成梦
醉酒成梦 2021-01-26 11:46

I have 2 same named classes defined in 2 different namespaces and I want to include both the namespaces as using statement in my c# file, Like below:

using A.B;
         


        
3条回答
  •  遥遥无期
    2021-01-26 12:13

    You can use fully qualified class name with namespace

    if (check)
    {
        var foo = new A.B.Foo();
    }
    else
    {
        var foo = new C.B.Foo();
    }
    

提交回复
热议问题