File tree Expand file tree Collapse file tree
Unicorn.Approvals/ApprovalsService
Unicorn.Web/PublicationManagerService Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99using Amazon . Lambda . Core ;
1010using Amazon . Util ;
1111using Amazon . XRay . Recorder . Handlers . AwsSdk ;
12- using DynamoDBContextConfig = Amazon . DynamoDBv2 . DataModel . DynamoDBContextConfig ;
1312using AWS . Lambda . Powertools . Logging ;
1413using AWS . Lambda . Powertools . Tracing ;
1514
@@ -39,8 +38,10 @@ public ContractStatusChangedEventHandler()
3938 AWSConfigsDynamoDB . Context . TypeMappings [ typeof ( ContractStatusChangedEvent ) ] =
4039 new TypeMapping ( typeof ( ContractStatusChangedEvent ) , dynamodbTable ) ;
4140
42- var config = new DynamoDBContextConfig { Conversion = DynamoDBEntryConversion . V2 } ;
43- _dynamoDbContext = new DynamoDBContext ( new AmazonDynamoDBClient ( ) , config ) ;
41+ _dynamoDbContext = new DynamoDBContextBuilder ( )
42+ . WithDynamoDBClient ( ( ) => new AmazonDynamoDBClient ( ) )
43+ . ConfigureContext ( config => config . Conversion = DynamoDBEntryConversion . V2 )
44+ . Build ( ) ;
4445 }
4546
4647
Original file line number Diff line number Diff line change 1111using Amazon . StepFunctions . Model ;
1212using Amazon . Util ;
1313using Amazon . XRay . Recorder . Handlers . AwsSdk ;
14- using DynamoDBContextConfig = Amazon . DynamoDBv2 . DataModel . DynamoDBContextConfig ;
1514using AWS . Lambda . Powertools . Logging ;
1615using AWS . Lambda . Powertools . Metrics ;
1716using AWS . Lambda . Powertools . Tracing ;
@@ -45,8 +44,10 @@ public PropertiesApprovalSyncFunction()
4544 AWSConfigsDynamoDB . Context . TypeMappings [ typeof ( ContractStatusItem ) ] =
4645 new TypeMapping ( typeof ( ContractStatusItem ) , dynamodbTable ) ;
4746
48- var config = new DynamoDBContextConfig { Conversion = DynamoDBEntryConversion . V2 } ;
49- _dynamoDbContext = new DynamoDBContext ( new AmazonDynamoDBClient ( ) , config ) ;
47+ _dynamoDbContext = new DynamoDBContextBuilder ( )
48+ . WithDynamoDBClient ( ( ) => new AmazonDynamoDBClient ( ) )
49+ . ConfigureContext ( config => config . Conversion = DynamoDBEntryConversion . V2 )
50+ . Build ( ) ;
5051
5152 // Initialise Step Functions client
5253 _amazonStepFunctionsClient = new AmazonStepFunctionsClient ( ) ;
Original file line number Diff line number Diff line change 88using Amazon . Lambda . Core ;
99using Amazon . Util ;
1010using Amazon . XRay . Recorder . Handlers . AwsSdk ;
11- using DynamoDBContextConfig = Amazon . DynamoDBv2 . DataModel . DynamoDBContextConfig ;
1211using AWS . Lambda . Powertools . Logging ;
1312using AWS . Lambda . Powertools . Metrics ;
1413using AWS . Lambda . Powertools . Tracing ;
@@ -42,8 +41,10 @@ public WaitForContractApprovalFunction()
4241 AWSConfigsDynamoDB . Context . TypeMappings [ typeof ( ContractStatusItem ) ] =
4342 new TypeMapping ( typeof ( ContractStatusItem ) , dynamodbTable ) ;
4443
45- var config = new DynamoDBContextConfig { Conversion = DynamoDBEntryConversion . V2 } ;
46- _dynamoDbContext = new DynamoDBContext ( new AmazonDynamoDBClient ( ) , config ) ;
44+ _dynamoDbContext = new DynamoDBContextBuilder ( )
45+ . WithDynamoDBClient ( ( ) => new AmazonDynamoDBClient ( ) )
46+ . ConfigureContext ( config => config . Conversion = DynamoDBEntryConversion . V2 )
47+ . Build ( ) ;
4748 }
4849
4950
Original file line number Diff line number Diff line change 1717using AWS . Lambda . Powertools . Metrics ;
1818using AWS . Lambda . Powertools . Tracing ;
1919using Unicorn . Web . Common ;
20- using DynamoDBContextConfig = Amazon . DynamoDBv2 . DataModel . DynamoDBContextConfig ;
2120
2221// Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class.
2322[ assembly: LambdaSerializer ( typeof ( Amazon . Lambda . Serialization . SystemTextJson . DefaultLambdaJsonSerializer ) ) ]
@@ -49,8 +48,10 @@ public RequestApprovalFunction()
4948 AWSConfigsDynamoDB . Context . TypeMappings [ typeof ( PropertyRecord ) ] =
5049 new TypeMapping ( typeof ( PropertyRecord ) , _dynamodbTable ) ;
5150
52- var config = new DynamoDBContextConfig { Conversion = DynamoDBEntryConversion . V2 } ;
53- _dynamoDbContext = new DynamoDBContext ( new AmazonDynamoDBClient ( ) , config ) ;
51+ _dynamoDbContext = new DynamoDBContextBuilder ( )
52+ . WithDynamoDBClient ( ( ) => new AmazonDynamoDBClient ( ) )
53+ . ConfigureContext ( config => config . Conversion = DynamoDBEntryConversion . V2 )
54+ . Build ( ) ;
5455
5556 // Initialise EventBridge client
5657 _eventBindingClient = new AmazonEventBridgeClient ( ) ;
You can’t perform that action at this time.
0 commit comments