Hi @Ravi Patel,
After testing the code in the blog, the source name seems depend on the namespace of your invoked method. So for dynamically get the source name, you can use the code below:
Type myType = typeof(Program); //The method exists in Program class, get the class type
var source = myType.Namespace;
If there has any problem, please let me know freely.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best Regards,
Rena