diff --git a/PlanB.Butler.Services/PlanB.Butler.Services/Controllers/RestaurantService.cs b/PlanB.Butler.Services/PlanB.Butler.Services/Controllers/RestaurantService.cs index 8670425..d5b368f 100644 --- a/PlanB.Butler.Services/PlanB.Butler.Services/Controllers/RestaurantService.cs +++ b/PlanB.Butler.Services/PlanB.Butler.Services/Controllers/RestaurantService.cs @@ -62,7 +62,7 @@ public static async Task GetRestaurants( EventId eventId = new EventId(correlationId.GetHashCode(), Constants.ButlerCorrelationTraceName); IActionResult actionResult = null; - List restaurant = new List(); + List restaurants = new List(); using (log.BeginScope("Method:{methodName} CorrelationId:{CorrelationId} Label:{Label}", methodName, correlationId.ToString(), context.InvocationId.ToString())) { try @@ -80,8 +80,16 @@ public static async Task GetRestaurants( } while (blobContinuationToken != null); + foreach (var item in cloudBlockBlobs) + { + CloudBlockBlob blob = (CloudBlockBlob)item; + var blobContent = blob.DownloadTextAsync(); + var blobRestaurant = JsonConvert.DeserializeObject(await blobContent); + restaurants.Add(blobRestaurant); + } + log.LogInformation(correlationId, $"'{methodName}' - success", trace); - actionResult = new OkObjectResult(restaurant); + actionResult = new OkObjectResult(restaurants); } catch (Exception e) {