Converting MongoDB documents into c# list of objects
<p>I am trying to write a method which would return all the Book documents from the MongoDB to my mvc application. First, I connect to database, retrieve collection and convert that collection into Json file. Next I create a list which has couple fields specified (name, author, etc.) using serializer i try to deserialize it into list and using a for loop return the list of books. Sadly I get error in the return line (convertion error). Any suggests are welcomed!</p>

<pre><code>public List&lt;Book&gt; getAllBooks() 
    {
        var mongoClient = new MongoClient("mongodb://localhost");
        var database = mongoClient.GetDatabase("SearchForKnowledge");
        var coll = database.GetCollection&lt;BsonDocument&gt;("Book");
        coll.ToJson();

        List&lt;Book&gt; collection = new List&lt;Book&gt;();

        JavaScriptSerializer js = new JavaScriptSerializer();
        collection = (List&lt;Book&gt;)Newtonsoft.Json.JsonConvert.DeserializeObject(coll.ToString());

        for (int i = 0; i &lt; collection.Count(); i++) 
        {
            return collection[i];
        }
    }
</code></pre>