Skip to content

Commit

Permalink
PlanBGmbH#78 Add metaData
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkusMeyer13 committed Feb 29, 2020
1 parent baa6f30 commit d758829
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ namespace PlanB.Butler.Services
/// </summary>
public static class RestaurantService
{
private const string MetaRestaurant = "restaurant";
private const string MetaCity = "city";

/// <summary>
/// Gets the restaurants.
/// </summary>
Expand Down Expand Up @@ -136,6 +139,8 @@ public static async Task<IActionResult> 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);

Expand Down

0 comments on commit d758829

Please sign in to comment.