-
Notifications
You must be signed in to change notification settings - Fork 855
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
OverrideTableName is not applied when passed in DynamoDBContext over DynamoDBOperationConfig #1218
Comments
Thanks for reporting this. I was able to reproduce, and I'm looking into how to fix it. |
Hi @michaelmatveev, you can get this to work if you instead use
|
I'm concerned that a proper fix to change aws-sdk-net/sdk/src/Services/DynamoDBv2/Custom/DataModel/Configs.cs Lines 298 to 299 in b691e46
|
I see this issue was closed by our new GitHub automation but I wanted to put some more context into this issue. You are passing an instance of If you are looking for away to do global table mapping changes take a look at using the |
In our next major version of the SDK (development underway now, see #3209), we've separated the hierarchy between var dynamoDbOperationConfig = new DynamoDBOperationConfig
{
OverrideTableName = _tableName
};
var context = new DynamoDBContext(_client, dynamoDbOperationConfig); // no longer possible in V4 We didn't want to take a single override table name as an input to the context object, since one can reuse a context object with multiple tables. If you do want to override table names on an application-level, you can use the |
Expected Behavior
Suppose I create DynamoDBContext like follows
then I try to use context expecting to save an item with a class name different then a table name
Current Behavior
Get an error
Possible Solution
Fix in the \sdk\src\Services\DynamoDBv2\Custom\DataModel\Configs.cs:
Steps to Reproduce (for bugs)
and the test
Context
Workaround is to pass DynamoDBOperationConfig to each operation
Your Environment
.NET Core Info
.NET Core SDK (reflecting any global.json):
Version: 2.1.503
Commit: 4c506e0f35
Runtime Environment:
OS Name: Windows Server 2016 Standard
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.1.503\
Host (useful for support):
Version: 2.1.7
Commit: cca5d72d48
.NET Core SDKs installed:
1.1.9 [C:\Program Files\dotnet\sdk]
2.1.2 [C:\Program Files\dotnet\sdk]
2.1.200 [C:\Program Files\dotnet\sdk]
2.1.202 [C:\Program Files\dotnet\sdk]
2.1.300 [C:\Program Files\dotnet\sdk]
2.1.400 [C:\Program Files\dotnet\sdk]
2.1.402 [C:\Program Files\dotnet\sdk]
2.1.503 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.11 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
The text was updated successfully, but these errors were encountered: