Nella classe BLL, ho scritto:Come usare System.Action con tipo restituito?
Private List<T> GetData(string a, string b)
{
TryAction(()=>{
//Call BLL Method to retrieve the list of BO.
return BLLInstance.GetAllList(a,b);
});
}
Nel BLL classe base, Ho un metodo:
protected void TryAction(Action action)
{
try
{
action();
}
catch(Exception e)
{
// write exception to output (Response.Write(str))
}
}
Come posso usare TryAction()
metodo con tipo di ritorno generica? si prega di avere un suggerimento.
Grazie aiutato molto. – Pravin