Following is my class with aliases List property of class type (MeetingAliases). How to add multiple items to aliases and pass as a parameter along with other TSGetRootObject property data to some method. for eg.
TSGetRootObject ts = new TSGetRootObject(); ts.aliases ???? //How to add data list here ts.name = id; ts.service_type = srvtype; ts = TransfomationSrv.PostData(ts); public class TSGetRootObject { [DataMember] [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public List<MeetingAliases> aliases { get; set; } [DataMember] [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public bool? allow_guests { get; set; } } public class MeetingAliases { [DataMember] [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public string alias { get; set; } [DataMember] [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public string conference { get; set; } [DataMember] [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public string description { get; set; } [DataMember] [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] public int? id { get; set; } }
ts.aliases = new List<MeetingAliases>(); ts.aliases.Add(new MeetingAliases());