Skip to content

Instantly share code, notes, and snippets.

@allenmichael
Last active December 10, 2015 21:53
Show Gist options
  • Save allenmichael/292cac9b3f08e9887ba3 to your computer and use it in GitHub Desktop.
Save allenmichael/292cac9b3f08e9887ba3 to your computer and use it in GitHub Desktop.
Add subnavlink to catalog parent page
public class SubnavLink
{
public string parentId { get; set; }
public string[] path { get; set; }
public string href { get; set; }
public string appId { get; set; }
public string windowTitle { get; set; }
}
[TestMethod]
public void SubnavLinks_Manually()
{
var applicationResource = new Mozu.Api.Resources.Commerce.Settings.ApplicationResource(_apiContext);
var entityResource = new Mozu.Api.Resources.Platform.Entitylists.EntityResource(_apiContext);
var SubnavLinkEntityName = "subnavlinks@mozu";
var appId = applicationResource.ThirdPartyGetApplicationAsync().Result.AppId;
var subnavLink = new SubnavLink()
{
appId = appId,
href = "https://75d65fb7.ngrok.io/",
parentId = "catalog",
path = new string[] { "Orders1" },
windowTitle = "Test1 Extension"
};
var entity = Newtonsoft.Json.Linq.JObject.FromObject(subnavLink);
var jObjectReturned = entityResource.InsertEntityAsync(entity, SubnavLinkEntityName).Result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment