title: How to convert c# arrays to JSON with one array item propety value set as reference to item from another
body: <p>To properly bind Java script arrays to AngularJs view I need them look like:</p>
  
  <pre><code>   var ingridients = [
         {name: 'Vodka'},
         {name: 'Gin'},
         {name: 'Rum'}
      ];
  
      var drinks = [
         {name: 'Bloody Mary', basicIngridient: ingridients[0]},
         {name: 'Gin &amp; Tonic', basicIngridient: ingridients[1]},
         {name: 'Daiquiry', basicIngridient: ingridients[2]}
      ];
  </code></pre>
  
  <p>Suppose I have c# arrays like:</p>
  
  <pre><code>    class Drink
          {
              public string Name { get; set; }
              public Ingridient BasicIngridient { get; set; }
          }
  
      class Ingridient
          {
              public string Name { get; set; }
          }
  
      static Ingridient[] ingridients = new Ingridient[] 
          { 
              new Ingridient { Name = "Vodka" },
              new Ingridient { Name = "Gin" },
              new Ingridient { Name = "Rum"}
          };
  
      Drink[] drinks = new Drink[]
          {
              new Drink{ Name = "Bloody Mary", BasicIngridient = ingridients[0]},
              new Drink{ Name = "Gin &amp; Tonic", BasicIngridient = ingridients[1]},
              new Drink{ Name = "Daiquiri", BasicIngridient = ingridients[2]}
          };
  </code></pre>
  
  <p>The question is: How could I convert these C# arrays to get needed JSON arrays?
  I know about JSON. Net library but I didn't manage to find the solution in docs. </p>