I have a method that I specify to be of a certain type.
E.g.
public MyLabels GetLabels<T>()
{
// I'd like to get the namespace of the type that T represents here
}
How can I do this?
Use the Namespace
property of Type
:
typeof(T).Namespace
MSDN
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