I have 2 classes, both are called the same "Product", 1 class is mine and the other belongs to somebody else.
I get a compile error in code as it appear some code is trying to use the Product from "my" class rather than "their".
I have temporary fixed this by prefixing there namespace on the lines that use the class.
I have the "using" of their class.
So whats the way to fix this, leave my prefix or reorder the namespaces... whcih should come first?
I suppose this gives me another problem... If i fix this issue and i need to reference my class then i am going to need to prefix that.
Any advise the best way to tackle this would be very helpful.
You can be explicit in your declarations, for example.
var myProduct = new MyCompany.MyLibrary.Product();
var otherProduct = new OtherCompany.OtherLibrary.Product();
You can even use the following :
using myNS = MyCompany.MyLibrary;
...
var myProduct = new myNS.Product();
You can also use a namespace alias directive.
using myProduct = SomeNameSpace.My;
using thierProduct = SomeNameSpace.Thier;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With