As a variable of the same type in C# can be assigned to another if they are not in the same branch of the inheritance?

Please tell me:
That is, in C#, that's the type XNamespace.
Inherited directly from System.Object.

At the same time this form of entry is quite legitimate:
XNamespace ds = "http://www.w3.org/2000/09/xmldsig#";


How is this possible? Because the string type is neither parent nor child to XNamespace, but this one is different.
June 7th 19 at 14:22
2 answers
June 7th 19 at 14:24
Solution
Because there is an operator which constructs XNamespace from the string.
https://msdn.microsoft.com/en-us/library/system.xm...
Thank you! - brendon78 commented on June 7th 19 at 14:27
June 7th 19 at 14:26
this means that there exists, or an overloaded assignment operator, but rather just the type extensionfor the required conversion

Find more questions by tags C#