、私は書かれています:System.Actionを戻り値の型で使用する方法BLLクラスで
Private List<T> GetData(string a, string b)
{
TryAction(()=>{
//Call BLL Method to retrieve the list of BO.
return BLLInstance.GetAllList(a,b);
});
}
をBLL基本クラスでは、私は方法があります:
protected void TryAction(Action action)
{
try
{
action();
}
catch(Exception e)
{
// write exception to output (Response.Write(str))
}
}
どのように私は、一般的な戻り値の型を持つTryAction()
メソッドを使用することができますか? ご提案をお願いします。
おかげでたくさん助け例です。 – Pravin