/// <summary>
        /// Gets a JSON representation for this error suitable for cross-domain
        /// </summary>
        /// <returns></returns>
        public string ToDetailedJson()
        {
            var serializer = new JavaScriptSerializer();

            return(serializer.Serialize(new
            {
                GUID,
                ApplicationName,
                CreationDate = CreationDate.ToEpochTime(),
                CustomData,
                DeletionDate = DeletionDate.ToEpochTime(),
                Detail,
                DuplicateCount,
                ErrorHash,
                HTTPMethod,
                Host,
                IPAddress,
                IsProtected,
                MachineName,
                Message,
                SQL,
                Source,
                StatusCode,
                Type,
                Url,
                QueryString = ServerVariables != null ? ServerVariables["QUERY_STRING"] : null,
                ServerVariables = ServerVariablesSerializable.ToJsonDictionary(),
                CookieVariables = CookiesSerializable.ToJsonDictionary(),
                RequestHeaders = RequestHeadersSerializable.ToJsonDictionary(),
                QueryStringVariables = QueryStringSerializable.ToJsonDictionary(),
                FormVariables = FormSerializable.ToJsonDictionary()
            }));
        }
示例#2
0
 public object ToDto()
 {
     return(new
     {
         ExceptionType,
         ExceptionSource,
         ExceptionMessage,
         ExceptionDetail,
         CustomData,
         HTTPMethod,
         Host,
         IPAddress,
         MachineName,
         StatusCode,
         Url,
         QueryString = ServerVariables?["QUERY_STRING"],
         ServerVariables = ServerVariablesSerializable.ToJsonDictionary(),
         CookieVariables = CookiesSerializable.ToJsonDictionary(),
         RequestHeaders = RequestHeadersSerializable.ToJsonDictionary(),
         QueryStringVariables = QueryStringSerializable.ToJsonDictionary(),
         FormVariables = FormSerializable.ToJsonDictionary()
     });
 }