Skip to content

Commit

Permalink
Update sample
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjanwestendorp committed Jan 17, 2023
1 parent 8d82857 commit ca03259
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@ public ActionResult<string> CreateImageCropperValues()
// Serialize the image cropper value
var cropperValue = JsonConvert.SerializeObject(cropper);

// Get the alias of the 'cropper' property
var testCropperAlias = Product.GetModelPropertyType(_publishedSnapshotAccessor, x => x.TestCropper)?.Alias;

// Set the value of the property with alias 'cropper'
if (content != null && !string.IsNullOrWhiteSpace(testCropperAlias))
{
// Set the value of the cropper
content.SetValue("testCropper", cropperValue, "en-US");

// Set the value of the cropper using the 'testCropperAlias' variable
content.SetValue(testCropperAlias, cropperValue, "en-US");
}

Expand Down

0 comments on commit ca03259

Please sign in to comment.