//void OurRaise(this ErrorSignal signal, Exception ex)
        //{
        //    if (ex is DbEntityValidationException)
        //    {
        //        var ve = ex as DbEntityValidationException;
        //        foreach (var error in ve.EntityValidationErrors)
        //        {
        //            var v = error.ValidationErrors.FirstOrDefault();
        //            if (v != null)
        //                signal.Raise(new DbEntityValidationException(
        //                                 string.Format("Validation Error :: {0} - {1}",
        //                                               v.PropertyName, v.ErrorMessage)));
        //        };
        //        return;
        //    }
        //    signal.Raise(ex);
        //}

        public ErrorLogEntry Raise(Exception e, HttpContext context)
        {
            if (context == null)
            {
                context = HttpContext.Current;
            }

            CustomErrorSignalEventHandler handler = Raised;

            if (handler != null)
            {
                var x = new CustomErrorSignalEventArgs(e, context);
                handler(this, x);

                return(x.ErrorLogEntry);
            }

            ErrorLog errorLog = ErrorLog.GetDefault(null);

            errorLog.ApplicationName = "ConsoleApplication";
            var err = errorLog.Log(new Error(e));

            return(errorLog.GetError(err));
        }
        /// <summary>
        /// The handler called when an exception is explicitly signaled.
        /// </summary>

        protected virtual void OnCustomErrorSignaled(object sender, CustomErrorSignalEventArgs args)
        {
            args.ErrorLogEntry = LogException(args.Exception, args.Context);
        }