Created
June 19, 2018 11:14
-
-
Save kgiszewski/2d90ac6e2c04d53bb993fa8dc97147a6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
namespace Models | |
{ | |
public class NestedContentModel | |
{ | |
//not sure if we need this | |
[JsonProperty("name")] | |
public string Name { get; set; } | |
//required for the doctype alias | |
[JsonProperty("ncContentTypeAlias")] | |
public string NcContentTypeAlias { get; set; } | |
//a textstring property from the doc type | |
[JsonProperty("value")] | |
public string Value { get; set; } | |
//do we need a key? | |
} | |
} | |
// then in a class | |
var ncModel = new List<NestedContentModel> | |
{ | |
new NestedContentModel | |
{ | |
Name = "Store Number", | |
Value = 1234 | |
} | |
}; | |
// then serialize and set it to a IContent | |
content.SetValue("someProprtyAlias", JsonConvert.SerializeObject(ncModel)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment