title: How to initialize the IEnumerable<CustomModel> in c#?
body: <p>.NET application. I have these classes:</p>
  
  <pre><code>public class Product
  {
      public string BrandDescription { get; set; }
      public string StyleNumber { get; set; }
  
      public FamilyTree FamilyTree { get; set; }
      public DssProduct DssProduct { get; set; }
  
      public IEnumerable&lt;OptionData&gt; Options { get; set; }
  }
  
  public class OptionData
  {
      public Guid Id { get; set; }
  
      public Colour PrimaryColour { get; set; }
      public Colour SecondaryColour { get; set; }
  
      public IEnumerable&lt;SizeData&gt; Sizes { get; set; }
  }
  
  public class Colour
  {
      public string Name { get; set; }
  }
  </code></pre>
  
  <p>I am trying to add some sample data to this model as below.</p>
  
  <pre><code>return new ProductMessageEvents()
          {
            Metadata = new KafkaProductEvent.Metadata
            {
              Timestamp = "test",
              Environment = "test"
            },
            Product = new KafkaProductEvent.Product
            {
              AgeGrading = "test",
              KeycodeType = "type1",
              FamilyTree = new KafkaProductEvent.FamilyTree
              {
                Class = new KafkaProductEvent.CodeNamePair
                {
                  Code = "test code",
                  Name = "test name"
                }
              },
              DssProduct = new KafkaProductEvent.DssProduct
              {
                DocumentStatus = "active"
              }
            },
            Version = "latestVersion"
          };
  </code></pre>
  
  <p>I tried as below.</p>
  
  <pre><code>Options = new OptionData[]
      {
        new OptionData
        {
          PrimaryColour = new Colour
          {
            Name = "White"
          }
        },
        new OptionData
        {
          PrimaryColour = new Colour
          {
            Name = "Green"
          }
        }
      }
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>Cannot implicitly Convert type ProductEvents.OptionData[] to  IList</p>
  </blockquote>
  
  <p>In the above code, I am not sure how to add data to Options. Can someone help me to 
  add data to IEnumerable of Option field? Any help would be appreciated. Thanks</p>