c# - 在 Visual Studio 中查看派生类的扩展方法调用?
问题描述
我在 oPersistentObject 上有一个扩展方法,它是许多不同对象的基类。
现在我想查看调用该方法的位置,但仅适用于 MaintenanceGroups(或任何其他派生类)。
我看不到任何简单的方法可以做到这一点。
原始方法签名:
public static void PersistThrowOnFailure( oPersistentObject persistent, ErrorDetector ed = null )
我想通的唯一方法:
public static void PersistThrowOnFailure( this ObjectPartGroup persistent, ErrorDetector ed = null ) => GenericPersistThrowOnFailure( persistent, ed );
public static void PersistThrowOnFailure( this Site persistent, ErrorDetector ed = null ) => GenericPersistThrowOnFailure( persistent, ed );
public static void PersistThrowOnFailure( this InteroperabilityAssetSettings persistent, ErrorDetector ed = null ) => GenericPersistThrowOnFailure( persistent, ed );
public static void GenericPersistThrowOnFailure( oPersistentObject persistent, ErrorDetector ed = null )
这可行,但很乏味。但是很高兴我可以看到每个派生类型调用该方法的次数。
有任何想法吗?
解决方案
推荐阅读
- swift - 在后台特定时间启动位置更新 - Swift (watchOS)
- dns - 如何将我的域连接到我的 FTP 服务器?
- bootstrap-4 - Bootstrap 4.3.1 列重新排序 class="order-md-1"
- azure - 如何在 Azure API 管理中自动更新 Web 服务 URL
- r - qwraps2 中的 summary_table 和 R 中的 group_by
- angular - Angular 反应式表单将表单组变成空表单控件
- react-native - React Native - 无效的钩子调用。钩子只能在函数组件的主体内部调用
- google-apps-script - 如果标题包含 x,则 Apps 脚本插入 2 列
- clojure - 允许任意规则顺序的语法
- angular - 无法通过选择读取材料表中未定义的属性“数据”