-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It is not possible to remove TableNamePrefix via DynamoDBOperationConfig #3470
Comments
Hello @Dreamescaper, Thank you for reporting the issue. As per the source code, if the Ideally I will further check on this with the team and keep you posted. Repro codePackage version: static async Task Main(string[] args)
{
//Create DDB table=`my-prefix-external-table` and Partition key as id(String)
var client = new AmazonDynamoDBClient();
var config = new DynamoDBContextConfig
{
TableNamePrefix = "my-prefix-"
};
var dynamoDbContext = new DynamoDBContext(client, config);
await dynamoDbContext.SaveAsync(new ExternalTable { Id = "1" }, new DynamoDBOperationConfig
{
TableNamePrefix = "",
OverrideTableName = "external-table"
});
}
[DynamoDBTable("test-table")]
public class ExternalTable
{
[DynamoDBHashKey]
[DynamoDBProperty("id")]
public string Id { get; set; } = null!;
} Regards, |
I assume that technically, changing that behavior would be a breaking change. |
Hello @Dreamescaper, Team will be fixing this issue as part of V4 efforts. Thank you again for reporting the issue. Regards, |
@bhoradc |
@Dreamescaper happy to take a PR for this change. Just be sure to target the |
Thanks again for the contribution, your PR was included in the latest preview of the SDK that was just released: https://www.nuget.org/packages/AWSSDK.DynamoDBv2/4.0.0-preview.3 |
Comments on closed issues are hard for our team to see. |
Describe the bug
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
The text was updated successfully, but these errors were encountered: