THIS WORKS:
public static async Task<T> GetClientDataAsync(string id)
{
var task = dynamoDBClient.GetItemAsync(new GetItemRequest
{
TableName = "x",
Key = new Dictionary<string, AttributeValue>
{
{ "ID", new AttributeValue { S = id } }
}
}).Result;
return task.IsItemSet ? task.Item : null;
}
THIS DOES NOT:
public static async Task<T> GetClientDataAsync(string id)
{
var task = await dynamoDBClient.GetItemAsync(new GetItemRequest
{
TableName = "x",
Key = new Dictionary<string, AttributeValue>
{
{ "ID", new AttributeValue { S = id } }
}
});
return task.IsItemSet ? task.Item : null;
}
When calling the method with something like var result = GetClientDataAsync(...).Result The second one hangs forever.