[CSHARP-564] Serialization fails if property declared as an interface has a value of null Created: 09/Sep/12  Updated: 20/Mar/14  Resolved: 09/Sep/12

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.6
Fix Version/s: 1.6.1

Type: Bug Priority: Major - P3
Reporter: Robert Stam Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by CSHARP-577 MongoDB.BSON.dll does not Serialize S... Closed

 Description   

To reproduce use these classes:

    interface IWhatever { }
    class Whatever : IWhatever { }
 
    class Person
    {
        public IWhatever Whatever { get; set; }
    }

and this code:

                var p = new Person();
                var json = p.ToJson();



 Comments   
Comment by auto [ 25/Sep/12 ]

Author:

{u'date': u'2012-09-08T22:45:42-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}

Message: CSHARP-564: fix serialization of properties declared as an interface and having a value of null.
Branch: x2.0
https://github.com/mongodb/mongo-csharp-driver/commit/53eaf227ef799b8da99b3db51d4d2f4c35d747ab

Comment by Robert Stam [ 09/Sep/12 ]

Pushed to master.

Comment by auto [ 09/Sep/12 ]

Author:

{u'date': u'2012-09-08T22:45:42-07:00', u'email': u'robert@10gen.com', u'name': u'rstam'}

Message: CSHARP-564: fix serialization of properties declared as an interface and having a value of null.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/98a01290ffd0ae4e46aa5f96a5b4acce4bc6a5a1

Comment by Robert Stam [ 09/Sep/12 ]

In code review.

Generated at Wed Feb 07 21:37:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.