-
-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathSimpleInnerError.cs
More file actions
58 lines (49 loc) · 1.96 KB
/
Copy pathSimpleInnerError.cs
File metadata and controls
58 lines (49 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
namespace Exceptionless.Models.Data {
public class SimpleInnerError : IData {
public SimpleInnerError() {
Data = new DataDictionary();
}
/// <summary>
/// The error message.
/// </summary>
public string Message { get; set; }
/// <summary>
/// The error type.
/// </summary>
public string Type { get; set; }
/// <summary>
/// The stack trace for the error.
/// </summary>
public string StackTrace { get; set; }
/// <summary>
/// Extended data entries for this error.
/// </summary>
public DataDictionary Data { get; set; }
/// <summary>
/// An inner (nested) error.
/// </summary>
public SimpleInnerError Inner { get; set; }
protected bool Equals(SimpleInnerError other) {
return string.Equals(Message, other.Message) && string.Equals(Type, other.Type) && string.Equals(StackTrace, other.StackTrace) && Equals(Data, other.Data) && Equals(Inner, other.Inner);
}
public override bool Equals(object obj) {
if (ReferenceEquals(null, obj))
return false;
if (ReferenceEquals(this, obj))
return true;
if (obj.GetType() != this.GetType())
return false;
return Equals((SimpleInnerError)obj);
}
public override int GetHashCode() {
unchecked {
var hashCode = Message == null ? 0 : Message.GetHashCode();
hashCode = (hashCode * 397) ^ (Type == null ? 0 : Type.GetHashCode());
hashCode = (hashCode * 397) ^ (StackTrace == null ? 0 : StackTrace.GetHashCode());
hashCode = (hashCode * 397) ^ (Data == null ? 0 : Data.GetCollectionHashCode());
hashCode = (hashCode * 397) ^ (Inner == null ? 0 : Inner.GetHashCode());
return hashCode;
}
}
}
}