@@ -9,21 +9,21 @@ public readonly struct DynamoDbDataMember
9
9
{
10
10
public DynamoDbDataMember ( in DataMember dataMember , IReadOnlyList < AttributeData > attributeData )
11
11
{
12
- Attributes = attributeData ;
13
- AttributeName = Attributes
12
+ _attributes = attributeData ;
13
+ AttributeName = _attributes
14
14
. Select ( AttributeNameSelector )
15
15
. FirstOrDefault ( x => string . IsNullOrWhiteSpace ( x ) is false ) ?? dataMember . Name ;
16
16
DataMember = dataMember ;
17
17
}
18
18
19
- private static string ? AttributeNameSelector ( AttributeData attributeData1 )
19
+ private static string ? AttributeNameSelector ( AttributeData attributeData )
20
20
{
21
- return attributeData1 switch
21
+ return attributeData switch
22
22
{
23
23
{ AttributeClass : null } => null ,
24
- { AttributeClass . Name : Constants . AWSSDK_DynamoDBv2 . Attribute . DynamoDBHashKey , ConstructorArguments . Length : 1 } when FilterString ( attributeData1 . ConstructorArguments [ 0 ] ) is { } attributeName => attributeName ,
25
- { AttributeClass . Name : Constants . AWSSDK_DynamoDBv2 . Attribute . DynamoDBRangeKey , ConstructorArguments . Length : 1 } when FilterString ( attributeData1 . ConstructorArguments [ 0 ] ) is { } attributeName => attributeName ,
26
- { AttributeClass . Name : Constants . AWSSDK_DynamoDBv2 . Attribute . DynamoDBProperty , ConstructorArguments . Length : 1 } when FilterString ( attributeData1 . ConstructorArguments [ 0 ] ) is { } attributeName => attributeName ,
24
+ { AttributeClass . Name : Constants . AWSSDK_DynamoDBv2 . Attribute . DynamoDBHashKey , ConstructorArguments . Length : 1 } when FilterString ( attributeData . ConstructorArguments [ 0 ] ) is { } attributeName => attributeName ,
25
+ { AttributeClass . Name : Constants . AWSSDK_DynamoDBv2 . Attribute . DynamoDBRangeKey , ConstructorArguments . Length : 1 } when FilterString ( attributeData . ConstructorArguments [ 0 ] ) is { } attributeName => attributeName ,
26
+ { AttributeClass . Name : Constants . AWSSDK_DynamoDBv2 . Attribute . DynamoDBProperty , ConstructorArguments . Length : 1 } when FilterString ( attributeData . ConstructorArguments [ 0 ] ) is { } attributeName => attributeName ,
27
27
{
28
28
AttributeClass . Name : Constants . AWSSDK_DynamoDBv2 . Attribute . DynamoDBHashKey or Constants . AWSSDK_DynamoDBv2 . Attribute . DynamoDBRangeKey or Constants . AWSSDK_DynamoDBv2 . Attribute . DynamoDBProperty ,
29
29
ConstructorArguments . Length : > 0
@@ -44,7 +44,7 @@ public DynamoDbDataMember(in DataMember dataMember, IReadOnlyList<AttributeData>
44
44
/// <inheritdoc cref="Types.DataMember" />
45
45
public DataMember DataMember { get ; }
46
46
47
- private IReadOnlyList < AttributeData > Attributes { get ; }
47
+ private readonly IReadOnlyList < AttributeData > _attributes ;
48
48
49
49
50
50
public static AttributeData [ ] GetDynamoDbAttributes ( ISymbol symbol )
@@ -57,13 +57,12 @@ public static AttributeData[] GetDynamoDbAttributes(ISymbol symbol)
57
57
public static bool IsIgnored ( AttributeData [ ] attributes )
58
58
{
59
59
return attributes . Length is not 0 && attributes . Any ( x => x . AttributeClass is { Name : Constants . AWSSDK_DynamoDBv2 . Attribute . DynamoDBIgnore } ) ;
60
-
61
60
}
62
61
63
62
public static DynamoDBKeyStructure ? GetKeyStructure ( IEnumerable < DynamoDbDataMember > members )
64
63
{
65
64
var items = members
66
- . SelectMany ( x => x . Attributes , ( x , y ) => ( DataMember : x , Attribute : y ) )
65
+ . SelectMany ( x => x . _attributes , ( x , y ) => ( DataMember : x , Attribute : y ) )
67
66
. ToArray ( ) ;
68
67
69
68
var partitionKey = items
0 commit comments