title: Can we initialize an object/collection using LINQ in JSON-like syntax?
body: <p><strong>Can we do something like this or something similar?</strong></p>
  
  <pre><code>var staffs = {
                 "Staff": 
                 [
                  { "ID" : 1, "Name" : "John" },
                  { "ID" : 2, "Name" : "Mark"}
                 ]
              };
  
  foreach (var staff in staffs)
  {
      Console.WriteLine("ID: {0}", staff.ID);
      Console.WriteLine("Name: {0}", staff.Name);
  }
  </code></pre>
  
  <p><br /><br />
  <strong>Instead of this long code:</strong></p>
  
  <pre><code>public class Test
  {
      protected void Page_Load(object sender, EventArgs e)
      {
          if (Page.IsPostBack)
              return;
  
          List&lt;Staff&gt; staffs = new List&lt;Staff&gt;()
          {
              new Staff() {ID = 1, Name = "John"},
              new Staff() {ID = 2, Name = "Mark"}
          };
  
          foreach (var staff in staffs)
          {
              Console.WriteLine("ID: {0}", staff.ID);
              Console.WriteLine("Name: {0}", staff.Name);
          }
      }
  }
  
  public class Staff
  {
      public int ID { get; set; }
      public string Name { get; set; }
  }
  </code></pre>
  
  <p>I tried but Visual Studio shows syntax error.</p>