How to skip a method in increments of (F11)

Let's look at the following example:

public static class Extensions
{
    public static string MakeString(this object obj)
    {
        if (obj == null) return string.Empty;

        return obj.ToString();
    }
}

public class ABC
{
    public void Method()
    {
        object obj = default(object);

        //Implemention goes here..

        // Here every time in step into navigate to MakeString() Method.
        if(IsValid(obj.MakeString()))             
        {
            //Operations..
        }
    }

    private bool IsValid(string str)
    {
        //Check if string is valid or not..
        return true;
    }
}

In this example, a class Extentionsthat has an extension method, and I use it in the class ABC, and when you go into a condition with this extension and another method call, then every time I enter the method MakeString(), can we skip it? Using method attribute? or another way?

+4
source share
1 answer

You can use the DebuggerStepThrough attribute to do this.

+6
source

Source: https://habr.com/ru/post/1539423/


All Articles