Category: c#


  • Uncovering Hidden C# Features: CallerMemberName and CallerLineNumber

    Letโ€™s say you have a utility function thatโ€™s used by multiple other functions to โ€œdo the thing,โ€ and you want to log or print which function actually called this utility. How would you do that? For example, consider a function that extracts the user ID from a JWT token: Now, we want to log who…