title: How to convert a list of anonymous object to string array using linq for return using Json Result in ASP.NET MVC
body: <p>I currently have a list of a book object as follows:</p>
  
  <pre><code>public class Book()
  {
      public int BookId { get; set; }
      public string Name { get; set; }
      public string Author { get; set; }
  }
  
  List&lt;Book&gt; books = BookRepository.SelectAll();
  </code></pre>
  
  <p>I would like to return a string list/array of Authors for return via a Json Result in my action method. At the moment I have done:</p>
  
  <pre><code>var result = books.Select(p =&gt; new { p.Author }).ToList();
  return Json(new { authors = result });
  </code></pre>
  
  <p>However, inspecting the result gives the following JSON:</p>
  
  <pre><code>{
      authors: [
          { Author: "John" },
          { Author: "Gary" },
          { Author: "Bill" },
          { Author: "Ray" }
      ]
  }
  </code></pre>
  
  <p>However, I do not want each Author as a seperate object in the JSON. I would like the result as:</p>
  
  <pre><code>{
      authors: ["John", "Gary", "Bill", "Ray"]
  }
  </code></pre>
  
  <p>How do I go about achieving this?</p>