Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DataObjectFieldAttribute.cs
Go to the documentation of this file.
2
4
5[AttributeUsage(AttributeTargets.Property)]
7{
8 public bool IsIdentity { get; }
9
10 public bool IsNullable { get; }
11
12 public int Length { get; }
13
14 public bool PrimaryKey { get; }
15
16 public DataObjectFieldAttribute(bool primaryKey)
17 : this(primaryKey, isIdentity: false, isNullable: false, -1)
18 {
19 }
20
21 public DataObjectFieldAttribute(bool primaryKey, bool isIdentity)
22 : this(primaryKey, isIdentity, isNullable: false, -1)
23 {
24 }
25
26 public DataObjectFieldAttribute(bool primaryKey, bool isIdentity, bool isNullable)
27 : this(primaryKey, isIdentity, isNullable, -1)
28 {
29 }
30
31 public DataObjectFieldAttribute(bool primaryKey, bool isIdentity, bool isNullable, int length)
32 {
33 PrimaryKey = primaryKey;
34 IsIdentity = isIdentity;
35 IsNullable = isNullable;
36 Length = length;
37 }
38
39 public override bool Equals([NotNullWhen(true)] object? obj)
40 {
41 if (obj == this)
42 {
43 return true;
44 }
45 if (obj is DataObjectFieldAttribute dataObjectFieldAttribute && dataObjectFieldAttribute.IsIdentity == IsIdentity && dataObjectFieldAttribute.IsNullable == IsNullable && dataObjectFieldAttribute.Length == Length)
46 {
47 return dataObjectFieldAttribute.PrimaryKey == PrimaryKey;
48 }
49 return false;
50 }
51
52 public override int GetHashCode()
53 {
54 return base.GetHashCode();
55 }
56}
DataObjectFieldAttribute(bool primaryKey, bool isIdentity)
DataObjectFieldAttribute(bool primaryKey, bool isIdentity, bool isNullable)
DataObjectFieldAttribute(bool primaryKey, bool isIdentity, bool isNullable, int length)
override bool Equals([NotNullWhen(true)] object? obj)