Skip to content

Commit

Permalink
better patterns in the Service Collection Extensions (use the extensi…
Browse files Browse the repository at this point in the history
…on methods as intended)
  • Loading branch information
stu-mck committed Apr 28, 2023
1 parent 406f486 commit e1829f8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static class ServiceCollectionExtensions
public static WorkflowOptions UseAwsSimpleQueueService(this WorkflowOptions options, AWSCredentials credentials, AmazonSQSConfig config, string queuesPrefix = "workflowcore")
{
var sqsClient = new AmazonSQSClient(credentials, config);
return UseAwsSimpleQueueServiceWithProvisionedClient(options, sqsClient, queuesPrefix);
return options.UseAwsSimpleQueueServiceWithProvisionedClient(sqsClient, queuesPrefix);
}

public static WorkflowOptions UseAwsSimpleQueueServiceWithProvisionedClient(this WorkflowOptions options, AmazonSQSClient sqsClient, string queuesPrefix = "workflowcore")
Expand All @@ -29,7 +29,7 @@ public static WorkflowOptions UseAwsSimpleQueueServiceWithProvisionedClient(this
public static WorkflowOptions UseAwsDynamoLocking(this WorkflowOptions options, AWSCredentials credentials, AmazonDynamoDBConfig config, string tableName)
{
var dbClient = new AmazonDynamoDBClient(credentials, config);
return UseAwsDynamoLockingWithProvisionedClient(options, dbClient, tableName);
return options.UseAwsDynamoLockingWithProvisionedClient(dbClient, tableName);
}

public static WorkflowOptions UseAwsDynamoLockingWithProvisionedClient (this WorkflowOptions options, AmazonDynamoDBClient dynamoClient, string tableName)
Expand All @@ -41,7 +41,7 @@ public static WorkflowOptions UseAwsDynamoLockingWithProvisionedClient (this Wor
public static WorkflowOptions UseAwsDynamoPersistence(this WorkflowOptions options, AWSCredentials credentials, AmazonDynamoDBConfig config, string tablePrefix)
{
var dbClient = new AmazonDynamoDBClient(credentials, config);
return UseAwsDynamoPersistenceWithProvisionedClient(options, dbClient, tablePrefix);
return options.UseAwsDynamoPersistenceWithProvisionedClient(dbClient, tablePrefix);
}

public static WorkflowOptions UseAwsDynamoPersistenceWithProvisionedClient(this WorkflowOptions options, AmazonDynamoDBClient dynamoClient, string tablePrefix)
Expand All @@ -56,7 +56,7 @@ public static WorkflowOptions UseAwsKinesis(this WorkflowOptions options, AWSCre
var kinesisClient = new AmazonKinesisClient(credentials, region);
var dynamoClient = new AmazonDynamoDBClient(credentials, region);

return UseAwsKinesisWithProvisionedClients(options, kinesisClient, dynamoClient,appName, streamName);
return options.UseAwsKinesisWithProvisionedClients(kinesisClient, dynamoClient,appName, streamName);

}

Expand Down

0 comments on commit e1829f8

Please sign in to comment.