コード例 #1
0
        private static ModelViews.ExceptionLog.Extend Create(ModelViews.ExceptionLog.Extend view)
        {
            var data = new DAL.exceptionLog();

            try
            {
                using (var ctx = new TraditionEntities())
                {
                    if (view.Id == 0)
                    {

                        data.exceptionStack = view.ExceptionStack;
                        data.errorState = view.ErrorState;
                        data.customInfo = view.CustomInfo;
                        data.created = DateTime.Now;
                        data.exceptionMessage = view.ExceptionMessage;
                        data.exceptionSource = view.ExceptionSource;
                        data.exceptionTargetsite = view.ExceptionTargetsite;
                        data.exceptionData = view.ExceptionData;
                        ctx.exceptionLogs.AddObject(data);
                        ctx.SaveChanges();

                    }
                }
            }
            catch (Exception ex)
            {
                //data = new DAL.exceptionLog();
                //ExceptionLog.CreateExceptionLog(ex, ExceptionLog.ErrorState.Significant, "ExceptionLogController.Create");
            }

            return Mappers.ExceptionLog.Basic(data);
        }
コード例 #2
0
        private static ModelViews.ExceptionLog.Extend Create(ModelViews.ExceptionLog.Extend view)
        {
            var data = new DAL.exceptionLog();

            try
            {
                using (var ctx = new TraditionEntities())
                {
                    if (view.Id == 0)
                    {
                        data.exceptionStack      = view.ExceptionStack;
                        data.errorState          = view.ErrorState;
                        data.customInfo          = view.CustomInfo;
                        data.created             = DateTime.Now;
                        data.exceptionMessage    = view.ExceptionMessage;
                        data.exceptionSource     = view.ExceptionSource;
                        data.exceptionTargetsite = view.ExceptionTargetsite;
                        data.exceptionData       = view.ExceptionData;
                        ctx.exceptionLogs.AddObject(data);
                        ctx.SaveChanges();
                    }
                }
            }
            catch (Exception ex)
            {
                //data = new DAL.exceptionLog();
                //ExceptionLog.CreateExceptionLog(ex, ExceptionLog.ErrorState.Significant, "ExceptionLogController.Create");
            }

            return(Mappers.ExceptionLog.Basic(data));
        }