Skip to main content
fix code indentation
Source Link
Gilad Green
  • 37.3k
  • 7
  • 67
  • 99

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; } } 

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; } } 

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; } } 
Source Link
c.jack
  • 375
  • 1
  • 3
  • 18

How to add Items to the property of class type

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; } }