I have a service layer which references the dao layer. I use ninject's inversion control to tie the implementation.
public class DaoA : IDaoA
{
private DaoA _dao;
public void daoMethod() {
//throw DBUpdate exception
}
}
public class ServiceA : BaseService
{
private DaoA _dao;
public result methodA() {
_dao.daoMethod();
}
}
Now I would like to avoid the try catch
block in the daoMethod
. Is there a way I could catch this exception at some BaseService
like we do to catch OnException
method in the Attribute
classes in .NET?