title: How to store Class into List in C#
body: <p>I know this may be silly question. But to be formal I want to store these Class field into list. I tried multiple times but still same things I am facing. I already spend couple of days' to fix this error but unsuccess Please help me on same
  I want to call web service and bind with drop down list. (Company, Country, Division, Location) which are there in class.
  But while storing in List I am not able to do that. Its thronging error for obvious region (<code>return type not matching</code>)
  Error:</p>
  <pre><code>(Can not implicitly convert type Almarai.GiveAway.GetInitiatorList.ALM_WKFLW_TYPE_M[] to Almarai.GiveAway.GetInitiatorList.INITIATORS_LIST[])
  </code></pre>
  <p>I understand due to return type its error appearing but how to store please guide me</p>
  <p>I tried like:</p>
  <pre><code>[WebMethod]
          public static List&lt;Devision&gt; GetAllFields()
          {
              string userID= &quot;1000&quot;;
              GetInitiatorList.MasterDataServiceClient oClient = new GetInitiatorList.MasterDataServiceClient();
              Almarai.GiveAway.GetInitiatorList.INITIATORS_LIST[] divisionMList = oClient.GetInitiatorsList(userID); 
  
              List&lt;Devision&gt; Division = new List&lt;Devision&gt;();
              foreach (Almarai.GiveAway.GetInitiatorList.INITIATORS_LIST Devision in divisionMList)
              {
                  Division.Add(new Devision()
                  {
                      DevisionCode = Devision.DivisionCode,
                      DevisionName = Devision.DivisionName
                  });
              }
              return Division;
          }
  </code></pre>
  <p>My class Inherit with <code>object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged</code></p>
  <p>I am not pretty sure about this type of object. Can any one Store these class into list</p>
  <p>Class:</p>
  <pre><code>[System.Diagnostics.DebuggerStepThroughAttribute()]
      [System.CodeDom.Compiler.GeneratedCodeAttribute(&quot;System.Runtime.Serialization&quot;, &quot;4.0.0.0&quot;)]
      [System.Runtime.Serialization.DataContractAttribute(Name=&quot;INITIATORS_LIST&quot;, Namespace=&quot;http://schemas.datacontract.org/2004/07/Almarai.Web.Services.DataEntities&quot;)]
      [System.SerializableAttribute()]
      public partial class INITIATORS_LIST : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
          
          [System.NonSerializedAttribute()]
          private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
          
          [System.Runtime.Serialization.OptionalFieldAttribute()]
          private Almarai.GiveAway.GetInitiatorList.ALM_COMPANY_M[] CompaniesField;
          
          [System.Runtime.Serialization.OptionalFieldAttribute()]
          private Almarai.GiveAway.GetInitiatorList.ALM_COUNTRY_M[] CountriesField;
          
          [System.Runtime.Serialization.OptionalFieldAttribute()]
          private Almarai.GiveAway.GetInitiatorList.ALM_DIVISION_M[] DivisionsField;
          
          [System.Runtime.Serialization.OptionalFieldAttribute()]
          private Almarai.GiveAway.GetInitiatorList.LOCATION[] LocationsField;
          
          [System.Runtime.Serialization.OptionalFieldAttribute()]
          private Almarai.GiveAway.GetInitiatorList.REGION[] RegionsField;
          
          [System.Runtime.Serialization.OptionalFieldAttribute()]
          private Almarai.GiveAway.GetInitiatorList.ALM_WKFLW_TYPE_M[] WorkflowTypesField;
          
          [global::System.ComponentModel.BrowsableAttribute(false)]
          public System.Runtime.Serialization.ExtensionDataObject ExtensionData {
              get {
                  return this.extensionDataField;
              }
              set {
                  this.extensionDataField = value;
              }
          }
          
          [System.Runtime.Serialization.DataMemberAttribute()]
          public Almarai.GiveAway.GetInitiatorList.ALM_COMPANY_M[] Companies {
              get {
                  return this.CompaniesField;
              }
              set {
                  if ((object.ReferenceEquals(this.CompaniesField, value) != true)) {
                      this.CompaniesField = value;
                      this.RaisePropertyChanged(&quot;Companies&quot;);
                  }
              }
          }
          
          [System.Runtime.Serialization.DataMemberAttribute()]
          public Almarai.GiveAway.GetInitiatorList.ALM_COUNTRY_M[] Countries {
              get {
                  return this.CountriesField;
              }
              set {
                  if ((object.ReferenceEquals(this.CountriesField, value) != true)) {
                      this.CountriesField = value;
                      this.RaisePropertyChanged(&quot;Countries&quot;);
                  }
              }
          }
          
          [System.Runtime.Serialization.DataMemberAttribute()]
          public Almarai.GiveAway.GetInitiatorList.ALM_DIVISION_M[] Divisions {
              get {
                  return this.DivisionsField;
              }
              set {
                  if ((object.ReferenceEquals(this.DivisionsField, value) != true)) {
                      this.DivisionsField = value;
                      this.RaisePropertyChanged(&quot;Divisions&quot;);
                  }
              }
          }
          
          [System.Runtime.Serialization.DataMemberAttribute()]
          public Almarai.GiveAway.GetInitiatorList.LOCATION[] Locations {
              get {
                  return this.LocationsField;
              }
              set {
                  if ((object.ReferenceEquals(this.LocationsField, value) != true)) {
                      this.LocationsField = value;
                      this.RaisePropertyChanged(&quot;Locations&quot;);
                  }
              }
          }
          
          [System.Runtime.Serialization.DataMemberAttribute()]
          public Almarai.GiveAway.GetInitiatorList.REGION[] Regions {
              get {
                  return this.RegionsField;
              }
              set {
                  if ((object.ReferenceEquals(this.RegionsField, value) != true)) {
                      this.RegionsField = value;
                      this.RaisePropertyChanged(&quot;Regions&quot;);
                  }
              }
          }
          
          [System.Runtime.Serialization.DataMemberAttribute()]
          public Almarai.GiveAway.GetInitiatorList.ALM_WKFLW_TYPE_M[] WorkflowTypes {
              get {
                  return this.WorkflowTypesField;
              }
              set {
                  if ((object.ReferenceEquals(this.WorkflowTypesField, value) != true)) {
                      this.WorkflowTypesField = value;
                      this.RaisePropertyChanged(&quot;WorkflowTypes&quot;);
                  }
              }
          }
          
          public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
          
          protected void RaisePropertyChanged(string propertyName) {
              System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
              if ((propertyChanged != null)) {
                  propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
              }
          }
      }
  </code></pre>
  <p>INITIATOR_LIST Class:</p>
  <pre><code>[System.Diagnostics.DebuggerStepThroughAttribute()]
      [System.CodeDom.Compiler.GeneratedCodeAttribute(&quot;System.Runtime.Serialization&quot;, &quot;4.0.0.0&quot;)]
      [System.Runtime.Serialization.DataContractAttribute(Name=&quot;INITIATORS_LIST&quot;, Namespace=&quot;http://schemas.datacontract.org/2004/07/Almarai.Web.Services.DataEntities&quot;)]
              [System.SerializableAttribute()]
              public partial class INITIATORS_LIST : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged {
                  
                  [System.NonSerializedAttribute()]
                  private System.Runtime.Serialization.ExtensionDataObject extensionDataField;
                  
                  [System.Runtime.Serialization.OptionalFieldAttribute()]
                  private Almarai.GiveAway.GetInitiatorList.ALM_COMPANY_M[] CompaniesField;
                  
                  [System.Runtime.Serialization.OptionalFieldAttribute()]
                  private Almarai.GiveAway.GetInitiatorList.ALM_COUNTRY_M[] CountriesField;
                  
                  [System.Runtime.Serialization.OptionalFieldAttribute()]
                  private Almarai.GiveAway.GetInitiatorList.ALM_DIVISION_M[] DivisionsField;
                  
                  [System.Runtime.Serialization.OptionalFieldAttribute()]
                  private Almarai.GiveAway.GetInitiatorList.LOCATION[] LocationsField;
                  
                  [System.Runtime.Serialization.OptionalFieldAttribute()]
                  private Almarai.GiveAway.GetInitiatorList.REGION[] RegionsField;
                  
                  [System.Runtime.Serialization.OptionalFieldAttribute()]
                  private Almarai.GiveAway.GetInitiatorList.ALM_WKFLW_TYPE_M[] WorkflowTypesField;
                  
                  [global::System.ComponentModel.BrowsableAttribute(false)]
                  public System.Runtime.Serialization.ExtensionDataObject ExtensionData {
                      get {
                          return this.extensionDataField;
                      }
                      set {
                          this.extensionDataField = value;
                      }
                  }
                  
                  [System.Runtime.Serialization.DataMemberAttribute()]
                  public Almarai.GiveAway.GetInitiatorList.ALM_COMPANY_M[] Companies {
                      get {
                          return this.CompaniesField;
                      }
                      set {
                          if ((object.ReferenceEquals(this.CompaniesField, value) != true)) {
                              this.CompaniesField = value;
                              this.RaisePropertyChanged(&quot;Companies&quot;);
                          }
                      }
                  }
                  
                  [System.Runtime.Serialization.DataMemberAttribute()]
                  public Almarai.GiveAway.GetInitiatorList.ALM_COUNTRY_M[] Countries {
                      get {
                          return this.CountriesField;
                      }
                      set {
                          if ((object.ReferenceEquals(this.CountriesField, value) != true)) {
                              this.CountriesField = value;
                              this.RaisePropertyChanged(&quot;Countries&quot;);
                          }
                      }
                  }
                  
                  [System.Runtime.Serialization.DataMemberAttribute()]
                  public Almarai.GiveAway.GetInitiatorList.ALM_DIVISION_M[] Divisions {
                      get {
                          return this.DivisionsField;
                      }
                      set {
                          if ((object.ReferenceEquals(this.DivisionsField, value) != true)) {
                              this.DivisionsField = value;
                              this.RaisePropertyChanged(&quot;Divisions&quot;);
                          }
                      }
                  }
                  
                  [System.Runtime.Serialization.DataMemberAttribute()]
                  public Almarai.GiveAway.GetInitiatorList.LOCATION[] Locations {
                      get {
                          return this.LocationsField;
                      }
                      set {
                          if ((object.ReferenceEquals(this.LocationsField, value) != true)) {
                              this.LocationsField = value;
                              this.RaisePropertyChanged(&quot;Locations&quot;);
                          }
                      }
                  }
                  
                  [System.Runtime.Serialization.DataMemberAttribute()]
                  public Almarai.GiveAway.GetInitiatorList.REGION[] Regions {
                      get {
                          return this.RegionsField;
                      }
                      set {
                          if ((object.ReferenceEquals(this.RegionsField, value) != true)) {
                              this.RegionsField = value;
                              this.RaisePropertyChanged(&quot;Regions&quot;);
                          }
                      }
                  }
                  
                  [System.Runtime.Serialization.DataMemberAttribute()]
                  public Almarai.GiveAway.GetInitiatorList.ALM_WKFLW_TYPE_M[] WorkflowTypes {
                      get {
                          return this.WorkflowTypesField;
                      }
                      set {
                          if ((object.ReferenceEquals(this.WorkflowTypesField, value) != true)) {
                              this.WorkflowTypesField = value;
                              this.RaisePropertyChanged(&quot;WorkflowTypes&quot;);
                          }
                      }
                  }
                  
                  public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
                  
                  protected void RaisePropertyChanged(string propertyName) {
                      System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
                      if ((propertyChanged != null)) {
                          propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
                      }
                  }
              }
  </code></pre>