C#
LLBL 2.0
adapter model
I have a set of BLL services. within different service functions i have blocks of code like this
using (adapter)
{
try
{
adapter.SaveCollection(...);
adapter.Commit();
}
catch (ORMException ex)
{
adapter.Rollback();
ExceptionPolicy.HandelException(ex, "name");
}
}
I would like to consolidate the exception logic and place the logging with the DataAccessAdapter.OnAfterTransactionRollback().
protected override void OnAfterTransactionRollback()
{
if (LastException != null)
{
//log exception
}
base.OnAfterTransactionRollback();
}
Is there a way to access the last exception thrown from the adapter? if I google "get last exception", I get references for Server.GetLastException() which is asp.net specific. I'm hoping for something that is GUI egnostic.