Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AssociationAttribute.cs
Go to the documentation of this file.
1
using
System.Collections.Generic
;
2
3
namespace
System.ComponentModel.DataAnnotations
;
4
5
[
AttributeUsage
(
AttributeTargets
.Property |
AttributeTargets
.Field, AllowMultiple =
false
,
Inherited
=
true
)]
6
[
Obsolete
(
"AssociationAttribute has been deprecated and is not supported."
)]
7
public
sealed
class
AssociationAttribute
:
Attribute
8
{
9
public
string
Name
{
get
; }
10
11
public
string
ThisKey
{
get
; }
12
13
public
string
OtherKey
{
get
; }
14
15
public
bool
IsForeignKey
{
get
;
set
; }
16
17
public
IEnumerable<string>
ThisKeyMembers
=>
GetKeyMembers
(
ThisKey
);
18
19
public
IEnumerable<string>
OtherKeyMembers
=>
GetKeyMembers
(
OtherKey
);
20
21
public
AssociationAttribute
(
string
name,
string
thisKey
,
string
otherKey
)
22
{
23
Name
= name;
24
ThisKey
=
thisKey
;
25
OtherKey
=
otherKey
;
26
}
27
28
private
static
string
[]
GetKeyMembers
(
string
key
)
29
{
30
if
(
key
==
null
)
31
{
32
return
Array
.Empty<
string
>();
33
}
34
return
key
.Replace(
" "
,
string
.
Empty
).Split(
','
);
35
}
36
}
System.Array
Definition
Array.cs:16
System.Attribute
Definition
Attribute.cs:12
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.ComponentModel.DataAnnotations.AssociationAttribute.OtherKeyMembers
IEnumerable< string > OtherKeyMembers
Definition
AssociationAttribute.cs:19
System.ComponentModel.DataAnnotations.AssociationAttribute.Name
string Name
Definition
AssociationAttribute.cs:9
System.ComponentModel.DataAnnotations.AssociationAttribute.ThisKeyMembers
IEnumerable< string > ThisKeyMembers
Definition
AssociationAttribute.cs:17
System.ComponentModel.DataAnnotations.AssociationAttribute.AssociationAttribute
AssociationAttribute(string name, string thisKey, string otherKey)
Definition
AssociationAttribute.cs:21
System.ComponentModel.DataAnnotations.AssociationAttribute.GetKeyMembers
static string[] GetKeyMembers(string key)
Definition
AssociationAttribute.cs:28
System.ComponentModel.DataAnnotations.AssociationAttribute.OtherKey
string OtherKey
Definition
AssociationAttribute.cs:13
System.ComponentModel.DataAnnotations.AssociationAttribute.IsForeignKey
bool IsForeignKey
Definition
AssociationAttribute.cs:15
System.ComponentModel.DataAnnotations.AssociationAttribute.ThisKey
string ThisKey
Definition
AssociationAttribute.cs:11
System.ComponentModel.DataAnnotations.AssociationAttribute
Definition
AssociationAttribute.cs:8
System.Empty
Definition
Empty.cs:4
System.Collections.Generic
Definition
IHashKeyCollection.cs:1
System.ComponentModel.DataAnnotations
Definition
ColumnAttribute.cs:3
System.ComponentModel.InheritanceLevel.Inherited
@ Inherited
System.ExceptionArgument.key
@ key
System.AttributeTargets
AttributeTargets
Definition
AttributeTargets.cs:5
source
System.ComponentModel.Annotations
System.ComponentModel.DataAnnotations
AssociationAttribute.cs
Generated by
1.10.0