❔ Get full namespace name
Hey, is there a way to get the full name of a namespace?
E.g.
nameof(DiscordBarista.Function.Partnership.Events)
gives me "Events"
but I want "Project_Sipster.DiscordBarista.Function.Partnership.Events"
returned.7 Replies
typeof(Whatever).Namespace iirc
Yes, but typeof requires a class. I can't pass in a Namespace name.
but you have a class in that namespace can just have a constant then ig, not sure. wait for someone who is more experience than me
Yeah, a couple. But I'd prefer a version in which I don't take any class of a namespace. ^^
Thanks tho!
no, you can't
not as a constant
actually u could, but its extremely over kill and a bit more complex:
u could make the class that should contain the namespace partial and generate the namespace's full qualified name via a source generator
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.