Skip to content

It is not possible to remove TableNamePrefix via DynamoDBOperationConfig #3470

Closed
@Dreamescaper

Description

@Dreamescaper

Describe the bug

	        [DynamoDBTable("test-table")]
	        class ExternalTable
	        {
				...
	        }

            var dynamoDbContext = new DynamoDBContext(new DynamoDBContextConfig
            {
                TableNamePrefix = "my-prefix-"
            });

            dynamoDbContext.SaveAsync(new ExternalTable { }, new DynamoDBOperationConfig
            {
                TableNamePrefix = "",
                OverrideTableName = "external-table"
            });

Expected Behavior

Since I have explicitly set TableNamePrefix to empty string, I would expect it to be empty, there SaveAsync would happen for "external-table" table name.

Current Behavior

TableNamePrefix = "" is ignored. SaveAsync is attempted for "my-prefix-external-table" table name.

Possible Solution

Create a separate context.

Additional Information/Context

DynamoDBFlatConfig uses string.IsNullOrEmpty comparison, therefore empty string is simply ignored.

AWS .NET SDK and/or Package version used

3.7.402.7

Targeted .NET Platform

.NET 8

Operating System and version

AmazonLinux

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.dynamodbp2This is a standard priority issuequeuedv4

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions