<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:36:14 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[CSHARP-239] Cant&apos; map a class with a member of the same Type.</title>
                <link>https://jira.mongodb.org/browse/CSHARP-239</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;If a class declare a member of the same class Type you get a mapping error.&lt;/p&gt;

&lt;p&gt;Possible change in BsonClassMap.cs  (all tests passed):&lt;/p&gt;

&lt;p&gt;/// &amp;lt;summary&amp;gt;&lt;br/&gt;
        /// Registers a class map.&lt;br/&gt;
        /// &amp;lt;/summary&amp;gt;&lt;br/&gt;
        /// &amp;lt;param name=&quot;classMap&quot;&amp;gt;The class map.&amp;lt;/param&amp;gt;&lt;br/&gt;
        public static void RegisterClassMap(&lt;br/&gt;
            BsonClassMap classMap&lt;br/&gt;
        ) {&lt;br/&gt;
            lock (BsonSerializer.ConfigLock) {&lt;br/&gt;
                // note: class maps can NOT be replaced (because derived classes refer to existing instance)&lt;br/&gt;
                // classMaps.Add(classMap.ClassType, classMap); ORIGINAL&lt;br/&gt;
                if (!classMaps.ContainsKey(classMap.ClassType))&lt;/p&gt;
                {
                    classMaps.Add(classMap.ClassType, classMap);
                    BsonDefaultSerializer.RegisterDiscriminator(classMap.ClassType, classMap.Discriminator);
                }
&lt;p&gt;            }&lt;br/&gt;
        }&lt;/p&gt;
</description>
                <environment>Windows</environment>
        <key id="17906">CSHARP-239</key>
            <summary>Cant&apos; map a class with a member of the same Type.</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="lbert">Luigi Bertazzo</reporter>
                        <labels>
                            <label>c#</label>
                            <label>mapping</label>
                    </labels>
                <created>Sat, 4 Jun 2011 20:07:03 +0000</created>
                <updated>Thu, 2 Apr 2015 18:28:13 +0000</updated>
                            <resolved>Wed, 8 Jun 2011 02:17:23 +0000</resolved>
                                    <version>1.0</version>
                                    <fixVersion>1.0</fixVersion>
                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="36601" author="rstam" created="Wed, 8 Jun 2011 02:17:01 +0000"  >&lt;p&gt;No worries. Thanks for letting us know you got it working.&lt;/p&gt;</comment>
                            <comment id="36579" author="lbert" created="Tue, 7 Jun 2011 20:32:26 +0000"  >&lt;p&gt;Not a bug, my fault in mapping the class: i was calling BsonClassMap.LookupClassMap(typeof(A)) inside BsonClassMap.RegisterClassMap&amp;lt;A&amp;gt; while setting some serialization options using IBsonSerializationOptions on the member with the same type A of the class being mapped. Really sorry to waste your time, thanks for your attention.&lt;/p&gt;</comment>
                            <comment id="36406" author="rstam" created="Mon, 6 Jun 2011 17:34:01 +0000"  >&lt;p&gt;I am unable to reproduce this. See the attached solution (TestSerializeRecursiveClass.zip).&lt;/p&gt;

&lt;p&gt;Can you provide more information? What does your class look like? What error are you getting?&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                            <comment id="36405" author="rstam" created="Mon, 6 Jun 2011 17:32:45 +0000"  >&lt;p&gt;Attempt to reproduce.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="12051" name="TestSerializeRecursiveClass.zip" size="3818" author="robert@mongodb.com" created="Mon, 6 Jun 2011 17:32:45 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrh8vr:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>14238</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>