title: Invalid initializer member declarator C# LINQ
body: <p>I have XML and need parse it and create objects via LINQ</p>
  
  <pre><code>&lt;?xml version="1.0"  encoding="UTF-8"?&gt; 
   &lt;Books&gt;         
     &lt;Book&gt; 
      &lt;ID&gt; number &lt;/ID&gt;
      &lt;DateCreated&gt; date &lt;/DateCreated&gt;  
      &lt;Pages&gt;  
       &lt;Page&gt;      
          &lt;PageID&gt; string &lt;/PageID&gt;  
          &lt;PageNumber&gt; number &lt;/PageNumber&gt; 
       &lt;/Page&gt;     
  
      &lt;!-- ... more Page nodes here if present ...     --&gt; 
      &lt;/Pages&gt;     
    &lt;/Book&gt; 
     &lt;!-- ... more Book nodes here ...     --&gt; 
  &lt;/Books&gt;
  </code></pre>
  
  <p>Classes:</p>
  
  <pre><code>public class BooksResponse
      {
          public Book[] Book_Items { get; set; }
      }
  
      public class Book
      {
          public int ID { get; set; }
          public string DateCreated { get; set; }
          public Page[] Pages { get; set; }
      }
  
      public class Page
      {
          public string PageID { get; set; }
          public int PageNumber { get; set; }
      }
  </code></pre>
  
  <p>and my code:</p>
  
  <pre><code>var booksResponse = xDocument
                              .Elements("Books")
                              .Select(x =&gt; new BooksResponse
                              {
                                  Book_Items = x.Elements("Book")
                                  .Select(c =&gt; new Book
                                  {
                                      DateCreated = (string)c.Element("DateCreated"),
                                      ID = (int)c.Element("ID"),
                                      Pages =&gt; c.Elements("Pages")
                                      .Select(y =&gt; new Page
                                      {
                                          PageID = (string)y.Element("PageID"),
                                          PageNumber = (int)y.Element("PageNumber"),
  
                                      }).ToArray()
  
                                  }).ToArray()
  
                              }).FirstOrDefault();
  </code></pre>
  
  <p>and near code Pages => c.Elements("Pages") </p>
  
  <p>error:</p>
  
  <p>Invalid initializer member declarator.</p>
  
  <p>What I'm doing wrong, how to fix that?</p>
  
  <p>Thanks a lot!</p>