En la clase BLL, he escrito:Cómo utilizar System.Action con return type?
Private List<T> GetData(string a, string b)
{
TryAction(()=>{
//Call BLL Method to retrieve the list of BO.
return BLLInstance.GetAllList(a,b);
});
}
en la clase base BLL, tengo un método:
protected void TryAction(Action action)
{
try
{
action();
}
catch(Exception e)
{
// write exception to output (Response.Write(str))
}
}
¿Cómo puedo usar TryAction()
método con el tipo de retorno genérico? tenga una sugerencia.
Gracias ayudaron mucho. – Pravin