From d758829110d09a115df796db4c6640a73c8e069d Mon Sep 17 00:00:00 2001 From: Markus Meyer Date: Sat, 29 Feb 2020 08:51:30 +0100 Subject: [PATCH] #78 Add metaData --- PlanB.Butler.Services/PlanB.Butler.Services/OrderService.cs | 1 + .../PlanB.Butler.Services/RestaurantService.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/PlanB.Butler.Services/PlanB.Butler.Services/OrderService.cs b/PlanB.Butler.Services/PlanB.Butler.Services/OrderService.cs index b6c050b..e49c246 100644 --- a/PlanB.Butler.Services/PlanB.Butler.Services/OrderService.cs +++ b/PlanB.Butler.Services/PlanB.Butler.Services/OrderService.cs @@ -181,6 +181,7 @@ public static async void PostDocumentOrder( blob.Metadata.Add("user", name); blob.Metadata.Add("date", stringDate); + blob.Metadata.Add(Constants.ButlerCorrelationTraceName, correlationId.ToString().Replace("-", string.Empty)); await blob.UploadTextAsync(payload); await blob.SetMetadataAsync(); trace.Add("data", payload); diff --git a/PlanB.Butler.Services/PlanB.Butler.Services/RestaurantService.cs b/PlanB.Butler.Services/PlanB.Butler.Services/RestaurantService.cs index 0240aa5..bc5a923 100644 --- a/PlanB.Butler.Services/PlanB.Butler.Services/RestaurantService.cs +++ b/PlanB.Butler.Services/PlanB.Butler.Services/RestaurantService.cs @@ -28,6 +28,9 @@ namespace PlanB.Butler.Services /// public static class RestaurantService { + private const string MetaRestaurant = "restaurant"; + private const string MetaCity = "city"; + /// /// Gets the restaurants. /// @@ -136,6 +139,8 @@ public static async Task CreateRestaurant( { blob.Properties.ContentType = "application/json"; blob.Metadata.Add(Constants.ButlerCorrelationTraceName, correlationId.ToString().Replace("-", string.Empty)); + blob.Metadata.Add(MetaRestaurant, System.Web.HttpUtility.HtmlEncode(restaurantModel.Name)); + blob.Metadata.Add(MetaCity, System.Web.HttpUtility.HtmlEncode(restaurantModel.City)); var restaurant = JsonConvert.SerializeObject(restaurantModel); trace.Add("restaurant", restaurant);