让我们举个例子:
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;
}
}
在此示例中,Extentions
类具有扩展方法,并在类 ABC
中使用它,并且当进入此扩展和其他方法调用的条件时,每次我进入MakeString()
方法,我们可以跳过吗?通过使用方法属性
?还是通过其他方式?
最佳答案
您可以使用 DebuggerStepThrough对此的属性。
关于c# - 如何在 step-into(F11) 中跳过方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23492763/