C
C#16mo ago
Dultus

❔ 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
basically, i am little cat
typeof(Whatever).Namespace iirc
Dultus
Dultus16mo ago
Yes, but typeof requires a class. I can't pass in a Namespace name.
basically, i am little cat
but you have a class in that namespace shook can just have a constant then ig, not sure. wait for someone who is more experience than me blobshrug
Dultus
Dultus16mo ago
Yeah, a couple. But I'd prefer a version in which I don't take any class of a namespace. ^^ Thanks tho!
Anton
Anton16mo ago
no, you can't not as a constant
cap5lut
cap5lut16mo ago
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
Accord
Accord16mo ago
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.
Want results from more Discord servers?
Add your server
More Posts