added serialization options convention.
CSHARP-356: All Update builder methods now throw an ArgumentNullException when called with an invalid null argument.
Merge branch 'serialization_convention' of git://github.com/craiggwilson/mongo-csharp-driver into csharp399
Merged CSHARP-399 pull request from Craig Wilson with minor changes (including some inconsistent line endings?).
CSHARP-378: Save now uses the serializer for the _id from the class map. This more general approach also handles the case where a string is represented in the database as an ObjectId so that special purpose code has been removed.
Implemented the predicate versions of Any, First, FirstOrDefault, Single and SingleOrDefault in LINQ queries. Added support for constant true/false predicates, which while not very commonly used are technically correct and we use them in the unit tests.
Implemented the predicate versions of Last and LastOrDefault in LINQ queries.
Added support for additional operators to VisitBinary and VisitUnary. Changed ExpressionFormatter so it never throws an exception; if something is not fully implemented it at least is formatted as "<XyzExpression>".
LINQ implementation now use custom serializers and serialization options when translating LINQ queries to MongoDB queries. Added GetElementNameAndSerializer and GetItemSerializer to IBsonSerializer. ArraySerializer now implements GetItemSerializer. BsonClassMapSerializer now has a reference to its corresponding BsonClassMap and implements GetElementNameAndSerializer. Fixed inconsistent line endings in BsonClassMap.
Added unit tests to check that all LINQ queries that can be used with an int[] property can also be used with a List<int> property. CollectionGenericSerializer now implements GetItemSerializer. BuildArrayLengthQuery now supports Count property and method.
Implemented MongoDBRefSerializer and MongoDBRef no longer implement IBsonSerializable so that LINQ queries can be written against the properties of MongoDBRef.
Implemented SystemProfileInfoSerializer so that LINQ queries can be written against the system.profile collection. Enhanced TimeSpanSerializer to support TimeSpanSerializationOptions and TimeSpanUnits.
Implemented CSHARP-404. Set AllowDuplicateNames to true when reading a BsonDocument returned from the server because sometimes the server returns documents with duplicate names.
Implemented support for enums in LINQ queries. Fixed BsonMemberMap.GetDefaultValue for enums.
Partial work towards supporting LINQ queries against array elements. Introduced BsonSerializationInfo class as return value of GetItemSerializationInfo and GetMemberSerializationInfo to cut down on out parameters. Added support for array indexing to ExpressionFormatter.
Made the Bson and Driver DLLs CLS compliant (the unit test DLLs don't need to be CLS compliant). Mostly accomplished by making protected fields private and wrapping protected properties around them. Also moved side effects of CurrentBsonType property to new GetCurrentBsonType method and made the CurrentBsonType property side effect free.
Fixed CSHARP-406. Made sure to release higher level locks before calling lower level methods and where possible moved time consuming operations outside of a lock.
More work towards supporting LINQ queries against array elements.
Finished implementing support for LINQ queries against array elements. Added lots more unit tests and made some minor fixes.
Implemented CSHARP-402. Added support in MongoServer for providing admin credentials for operations that require them without having to set them as the default credentials. The admin credentials can either be provided by storing them in the new MongoCredentialsStore or by using new overloads of the relevant methods that now have an adminCredentials parameter. Also removed several admin database related properties and methods from MongoServer (they should be rarely needed and can easily be replaced by passing "admin" as the database name to existing properties and methods).