Skip to content

Instantly share code, notes, and snippets.

@awswithdotnet
Created March 2, 2022 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awswithdotnet/a561d2a56c3c165ed4611f92a8c24b77 to your computer and use it in GitHub Desktop.
Save awswithdotnet/a561d2a56c3c165ed4611f92a8c24b77 to your computer and use it in GitHub Desktop.
DynamoDB DynamoDB VehicleController.cs Get
[HttpGet("{vin}")]
public async Task<IActionResult> Get(string vin)
{
Table table = Table.LoadTable(_client, "Vehicles");
Document vehicleDocument = await table.GetItemAsync(vin);
var vehicle = new Vehicle{
Vin = vehicleDocument["VIN"],
Year = vehicleDocument["YearManufactured"],
Make = vehicleDocument["Make"],
Model = vehicleDocument["Model"]
};
return Ok(vehicle);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment