예제 #1
0
 public void AddErrorLog(tbl_ErrorLog tblErrorLog)
 {
     try
     {
         IGenericDataRepository <tbl_ErrorLog> repository = new GenericDataRepository <tbl_ErrorLog>();
         repository.Add(tblErrorLog);
     }
     catch (Exception ex)
     {
         throw;
     }
 }
예제 #2
0
        public void LogError(Exception filterContext)
        {
            try
            {
                tbl_ErrorLog tblErrorLog = new tbl_ErrorLog();

                tblErrorLog.EntityState      = DA.DomainModel.EntityState.Added;
                tblErrorLog.ErrorDescription = Convert.ToString(@filterContext.InnerException);
                tblErrorLog.ClassName        = Convert.ToString(filterContext.TargetSite.ReflectedType.Name);
                tblErrorLog.StackTrace       = Convert.ToString(@filterContext.StackTrace.ToString());
                tblErrorLog.ErrorDate        = DateTime.Now;

                ErrorLogManager errorlogManager = new ErrorLogManager();
                errorlogManager.AddErrorLog(tblErrorLog);
            }
            catch (Exception)
            {
                throw;
            }
        }