Skip to content

Instantly share code, notes, and snippets.

Last active March 2, 2022 18:20
What would you like to do?
DynamoDB DynamoDB VehicleController.cs Post
public async Task<IActionResult> Post(Vehicle vehicle)
Table table = Table.LoadTable(_client, "Vehicles");
var vehicleDocument = new Document();
vehicleDocument["VIN"] = vehicle.Vin;
vehicleDocument["YearManufactured"] = vehicle.Year;
vehicleDocument["Make"] = vehicle.Make;
vehicleDocument["Model"] = vehicle.Model;
await table.PutItemAsync(vehicleDocument);
return Created("/vehicle/" + vehicle.Vin, vehicle);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment