我的代码如下所示.
try
{
_productRepo.GetAllProductCategories();
}
catch (Exception ex)
{
//Do Something
}
Run Code Online (Sandbox Code Playgroud)
我需要一种方法来显示方法名称,假设在上面的例子中,如果在GetAllProductCategories()方法中抛出任何异常,我需要获取此方法名称,即"GetAllProductCategories()"作为我的结果.谁能建议我怎么做?