Problems with serialization after update of C# driver

52 views
Skip to first unread message

Catsy

unread,
Jun 6, 2012, 2:55:59 PM6/6/12
to mongodb-csharp
Hello everyone,

I've updated the project with the new version of MongoDB C# driver
(1.4.2 against 1.2) and after the compilation I have huge amount or
errors. All of them are about updating the existing code - they
require my classes that implement IBsonSerializer to implement some
new methods like GetItemSerializationInfo,
GetDefaultSerializationOptions and GetMemberSerializationInfo. I
couldn't find any information about these methods including the
official MongoDB drivers site (it has only out-of-date info). Could
someone please explain me how to implement these methods or point to
the resource with the description?

Thanks

Robert Stam

unread,
Jun 6, 2012, 3:02:06 PM6/6/12
to mongodb...@googlegroups.com
The new methods are there to support LINQ queries. They are mentioned in the 1.4 release notes:


If you want to write LINQ queries against values serialized by your custom serializers you should implement the new methods. Otherwise you can add stubbed implementations that throw  NotImplementedException or NotSupportedExceptions.

Consider deriving your custom serializers from BsonBaseSerializer, which provides default implementations of the new methods.

These interfaces are changing yet again in 1.5 (sorry).

Catsy

unread,
Jun 7, 2012, 6:50:47 PM6/7/12
to mongodb-csharp
Thanks!

On Jun 6, 12:02 pm, Robert Stam <rob...@10gen.com> wrote:
> The new methods are there to support LINQ queries. They are mentioned in
> the 1.4 release notes:
>
> https://github.com/mongodb/mongo-csharp-driver/blob/master/Release%20...
Reply all
Reply to author
Forward
0 new messages