Created
March 2, 2022 18:21
-
-
Save awswithdotnet/a561d2a56c3c165ed4611f92a8c24b77 to your computer and use it in GitHub Desktop.
DynamoDB DynamoDB VehicleController.cs Get
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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