Life and Tech

.NET Core API with DynamoDB Context Dependency Injection

The Problem Today I faced a problem which I knew would come, but didn’t have time to implement properly at the time. There were more urgent tasks at hand before, deadlines to be met and this issue remained unresolved. Amazon’s .NET Core SDK is very good for the most part. Everything works as it should. But let’s say you use the .NET Object Persistence Model for DynamoDB in your service and you have mapped C# classes to DynamoDB tables like this: