C
C#10mo ago
2spooky2play

✅ `T` always value for `nameof`

int id = nameof(T).GetHashCode();
Console.WriteLine(nameof(T));
int id = nameof(T).GetHashCode();
Console.WriteLine(nameof(T));
how come nameof(T) always returns T instead of the type of the generic argument?
2 Replies
2spooky2play
2spooky2playOP10mo ago
fixed: needed to use typeof instead of nameof
MODiX
MODiX10mo ago
Use the /close command to mark a forum thread as answered

Did you find this page helpful?