using System.Collections.Generic;
public static void Main()
List<IModule> list = new List<IModule>();
list.Add( new Module { Name = "aaa" });
string json = JsonConvert.SerializeObject(list, Formatting.Indented);
[JsonProperty(PropertyName = "name", Required = Required.Always)]
public string Name { get; set; }
public bool ShouldSerializeName(){return true;}
public int Id { get; set; }
public int ParentId { get; set; }
public virtual bool ShouldSerializeParentId()
public override bool ShouldSerializeParentId()