Skip to content

Commit

Permalink
PlanBGmbH#66 Return restaurants
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusMeyer13 committed Mar 4, 2020
1 parent 0cf20e0 commit b8c2122
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static async Task<IActionResult> GetRestaurants(
EventId eventId = new EventId(correlationId.GetHashCode(), Constants.ButlerCorrelationTraceName);
IActionResult actionResult = null;

List<RestaurantModel> restaurant = new List<RestaurantModel>();
List<RestaurantModel> restaurants = new List<RestaurantModel>();
using (log.BeginScope("Method:{methodName} CorrelationId:{CorrelationId} Label:{Label}", methodName, correlationId.ToString(), context.InvocationId.ToString()))
{
try
Expand All @@ -80,8 +80,16 @@ public static async Task<IActionResult> GetRestaurants(
}
while (blobContinuationToken != null);

foreach (var item in cloudBlockBlobs)
{
CloudBlockBlob blob = (CloudBlockBlob)item;
var blobContent = blob.DownloadTextAsync();
var blobRestaurant = JsonConvert.DeserializeObject<RestaurantModel>(await blobContent);
restaurants.Add(blobRestaurant);
}

log.LogInformation(correlationId, $"'{methodName}' - success", trace);
actionResult = new OkObjectResult(restaurant);
actionResult = new OkObjectResult(restaurants);
}
catch (Exception e)
{
Expand Down

0 comments on commit b8c2122

Please sign in to comment.