public void Commit() { using (var transaction = _sessionFactoryWrapper.GetCurrentSession().BeginTransaction()) { try { transaction.Commit(); } catch (Exception ex) { _logger.LogError("An error occurred committing the transaction.", ex); transaction.Rollback(); throw; } } }
private ErrorViewModel ProcessError() { var model = new ErrorViewModel(); if (System.Web.HttpContext.Current.AllErrors == null) { return(model); } var ex = System.Web.HttpContext.Current.AllErrors[0]; var msg = GetErrorMessage(ex, false); _logger.LogError(msg, ex); model.Message = msg; return(model); }