[.NET Driver] "Disconnecting" an object from MongoDB

From: Karsten Kaehler <kk@xxxxxxxxxxxx>
To: mongodb-user <mongodb-user@xxxxxxxxxxxxxxxx>
Date: Wed, 4 May 2016 06:06:22 -0700 (PDT)
Why ads?
Hi folks,
I need some help!


If I try something like this

     var collection = _database.GetCollection<SomeObject>("Records");

     foreach (SomeObject s in collection.ToList())
     { 
         anotherObject.SomeProperty = s.SomeProperty;
     }


where anotherObject is not mapped to a MongoDb Collection I get an access 
to the database everytime I try to read from anotherObject.SomeProperty, 
which gives me a huge performance hit.
How can I get rid of this behaviour?

Many thanks!

-- 
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
--- 
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/cecf0079-32a4-41ca-b9f3-e06cc1728c28%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Why ads?