<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:39:26 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-1383] Unable to specify member map for generic base class.</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1383</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;If you have a generic base class in a contracts library that doesn&apos;t have a dependency on Mongo.&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;public Thing&amp;lt;T&amp;gt;&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;{&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;  public T Value { get; set; }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;  public Dictionary&amp;lt;string, object&amp;gt; Properties { get; set; }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;Using the current BsonClassMap there does not appear to be a way to indicate that Properties should be used as the ExtraElements attribute without checking that the type has been mapped on each call and creating a mapping then.&lt;/p&gt;</description>
                <environment></environment>
        <key id="226533">CSHARP-1383</key>
            <summary>Unable to specify member map for generic base class.</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="james.kovacs@mongodb.com">James Kovacs</assignee>
                                    <reporter username="veleek">Benjamin Randall</reporter>
                        <labels>
                    </labels>
                <created>Fri, 21 Aug 2015 00:22:52 +0000</created>
                <updated>Wed, 9 Nov 2022 20:04:26 +0000</updated>
                            <resolved>Wed, 9 Nov 2022 20:04:26 +0000</resolved>
                                    <version>2.2</version>
                                                    <component>BSON</component>
                    <component>Serialization</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="4968310" author="james.kovacs" created="Wed, 9 Nov 2022 20:04:26 +0000"  >&lt;p&gt;This feature can be implemented using a custom convention as discussed in the comments and demonstrated in the attached pull request. The PR was declined as this is not a common idiom and would be better suited for a blog post.&lt;/p&gt;</comment>
                            <comment id="1108987" author="veleek" created="Wed, 9 Dec 2015 00:58:11 +0000"  >&lt;p&gt;No change on my pull request.  Any idea when it will get looked at?&lt;/p&gt;</comment>
                            <comment id="1013153" author="veleek" created="Mon, 24 Aug 2015 18:22:18 +0000"  >&lt;p&gt;Here&apos;s the pull request: &lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/pull/214/commits&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/pull/214/commits&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1013083" author="veleek" created="Mon, 24 Aug 2015 17:11:28 +0000"  >&lt;p&gt;You are correct.   It looks like conventions would be the best option for this.  I&apos;ve got a fork out and I&apos;m writing up a simple example of how to write a generic convention.  I&apos;ll send a pull request when it&apos;s done.  Is there any way to assign this bug to me? Or should I just ping you when I&apos;m done.&lt;/p&gt;</comment>
                            <comment id="1011613" author="craiggwilson" created="Fri, 21 Aug 2015 13:12:37 +0000"  >&lt;p&gt;Ok, actually, for now, I think you may need to use conventions to handle this.  You&apos;ll need to write a custom convention (&lt;a href=&quot;http://mongodb.github.io/mongo-csharp-driver/2.0/reference/bson/mapping/conventions/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://mongodb.github.io/mongo-csharp-driver/2.0/reference/bson/mapping/conventions/&lt;/a&gt;). Basically, check to see if the type is generic and, if so, get its generic type definition and compare it to typeof(Thing&amp;lt;&amp;gt;). When this is true, find the Properties member and set it to be the extra elements,&lt;/p&gt;

&lt;p&gt;I think this type of thing is certainly worthy of an example in the documentation. In addition, we might should figure out how to make this easier, although this is the first question we&apos;ve had related to this topic.&lt;/p&gt;</comment>
                            <comment id="1011610" author="craiggwilson" created="Fri, 21 Aug 2015 13:09:17 +0000"  >&lt;p&gt;Oh, I think I see what you are talking about. The fact that your class is generic means you aren&apos;t able to use code because you don&apos;t necessarily know all the types that will be used.&lt;/p&gt;

&lt;p&gt;Hmm... Let me think on this for a little. We might need to add a feature to allow this sort of thing.&lt;/p&gt;</comment>
                            <comment id="1011607" author="craiggwilson" created="Fri, 21 Aug 2015 13:07:27 +0000"  >&lt;p&gt;Hi Benjamin,&lt;/p&gt;

&lt;p&gt;I don&apos;t know what the version of the driver you are using is. I&quot;m going to assume the latest, although this particular feature is supported back for a long time. &lt;/p&gt;

&lt;p&gt;Everything that can be done using attributes can be done via code.  This is demonstrated on the &lt;a href=&quot;http://mongodb.github.io/mongo-csharp-driver/2.0/reference/bson/mapping/#supporting-extra-elements&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;docs page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Craig&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </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|hst56f:</customfieldvalue>

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