We believe in listening to the voice of the customer. But to do that, we need you to speak. That’s what this Feature Request section of our site is for.

 

Here’s how to get your voice heard:

  1. VOTE for existing ideas (this will also subscribe you to the idea’s status updates)

  2. SUBMIT new ideas (Please include only one suggestion per post. Duplicates are merged together.)

  3. COMMENT on other ideas, which we check regularly

We also publish Roadmaps here, based off these Feature Requests, so you can see what we’re working on.

 

Note, this site is for new Feature Requests. Bug Reports should be emailed to Support as normal.

2 votes

EnterMethod/LeaveMethod - Remove the method name from the parameters by usage of CallerMemberName attribute

It is not necessary anymore to specify the method name on every call to EnterMethod/LeaveMethod.
The CallerMemberName attribute provides the name of the calling method automatically.

Try the snippet below.

void Main()
{
MethodNameToBeLogged();
}

public void MethodNameToBeLogged()
{
EnterMethod();
LeaveMethod();
}

public void EnterMethod([CallerMemberName] string memberName = "")
{
Console.WriteLine($"Entering method '{memberName}'");
}

public void LeaveMethod([CallerMemberName] string memberName = "")
{
Console.WriteLine($"Leaving method '{memberName}'");
}

Category: SmartInspect > Languages > .NET sahl04 shared this idea

Leave a Reply

Scroll to Top