<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:37:36 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-708] BsonClassMap.SetIdMember fails for lhamda expressions that contain interface members</title>
                <link>https://jira.mongodb.org/browse/CSHARP-708</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;We upgrade to the 1.8 driver via NuGet this morning and instantly brought down our dev environment. &lt;/p&gt;

&lt;p&gt;Here is part of the stack trace:&lt;/p&gt;

&lt;p&gt;at System.Linq.Enumerable.Single&lt;span class=&quot;error&quot;&gt;&amp;#91;TSource&amp;#93;&lt;/span&gt;(IEnumerable`1 source, Func`2 predicate) &lt;br/&gt;
   at MongoDB.Bson.Serialization.BsonClassMap`1.ResolveExplicitProperty(MemberInfo interfaceMemberInfo, Type targetType) &lt;br/&gt;
   at MongoDB.Bson.Serialization.BsonClassMap`1.GetMemberInfoFromLambda&lt;span class=&quot;error&quot;&gt;&amp;#91;TMember&amp;#93;&lt;/span&gt;(Expression`1 memberLambda) &lt;br/&gt;
   at MongoDB.Bson.Serialization.BsonClassMap`1.GetMemberNameFromLambda&lt;span class=&quot;error&quot;&gt;&amp;#91;TMember&amp;#93;&lt;/span&gt;(Expression`1 memberLambda)&lt;/p&gt;

&lt;p&gt;Here is some snippets that will show how to reproduce:&lt;/p&gt;

&lt;p&gt;protected override void ConfigureClassMap(BsonClassMap&amp;lt;T&amp;gt; cm) {&lt;br/&gt;
            cm.SetIdMember(cm.GetMemberMap(c =&amp;gt; c.Id).SetRepresentation(BsonType.ObjectId));&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;..&lt;br/&gt;
where T : class, IIdentity, new() {&lt;br/&gt;
..&lt;/p&gt;

&lt;p&gt;    public interface IIdentity {&lt;br/&gt;
        string Id &lt;/p&gt;
{ get; }
&lt;p&gt;    }&lt;/p&gt;

&lt;p&gt;..&lt;/p&gt;

&lt;p&gt;    public class JobHistory : IIdentity {&lt;br/&gt;
        public string Id &lt;/p&gt;
{ get; set; }
&lt;p&gt;}&lt;br/&gt;
..&lt;/p&gt;</description>
                <environment>Windows 8, MongoDB 2.4</environment>
        <key id="69118">CSHARP-708</key>
            <summary>BsonClassMap.SetIdMember fails for lhamda expressions that contain interface members</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="1" iconUrl="https://jira.mongodb.org/images/icons/priorities/blocker.svg">Blocker - P1</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="craig.wilson@mongodb.com">Craig Wilson</assignee>
                                    <reporter username="bniemyjski">Blake Niemyjski</reporter>
                        <labels>
                            <label>driver</label>
                    </labels>
                <created>Wed, 20 Mar 2013 15:40:36 +0000</created>
                <updated>Thu, 20 Mar 2014 14:36:43 +0000</updated>
                            <resolved>Thu, 21 Mar 2013 15:58:58 +0000</resolved>
                                    <version>1.8</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="294985" author="bniemyjski" created="Thu, 21 Mar 2013 16:01:27 +0000"  >&lt;p&gt;You guys are awesome!&lt;/p&gt;</comment>
                            <comment id="294159" author="auto" created="Wed, 20 Mar 2013 18:41:58 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2013-03-20T16:28:11Z&apos;, u&apos;name&apos;: u&apos;Craig Wilson&apos;, u&apos;email&apos;: u&apos;craiggwilson@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-708&quot; title=&quot;BsonClassMap.SetIdMember fails for lhamda expressions that contain interface members&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-708&quot;&gt;&lt;del&gt;CSHARP-708&lt;/del&gt;&lt;/a&gt;: fixed bug where interface maps were too strict with regards to mapping a member back to it&apos;s interface declaration.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/97bb29236f5fc11f7b60de653012e2721e8c23a9&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/97bb29236f5fc11f7b60de653012e2721e8c23a9&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="294158" author="auto" created="Wed, 20 Mar 2013 18:41:56 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;date&apos;: u&apos;2013-03-20T16:01:49Z&apos;, u&apos;name&apos;: u&apos;Craig Wilson&apos;, u&apos;email&apos;: u&apos;craiggwilson@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-708&quot; title=&quot;BsonClassMap.SetIdMember fails for lhamda expressions that contain interface members&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-708&quot;&gt;&lt;del&gt;CSHARP-708&lt;/del&gt;&lt;/a&gt;: added breaking test.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/9c969995219b0942d634682c54956cdc8c844a00&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/9c969995219b0942d634682c54956cdc8c844a00&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="294055" author="bniemyjski" created="Wed, 20 Mar 2013 16:53:27 +0000"  >&lt;p&gt;Hello,&lt;/p&gt;

&lt;p&gt;Thanks for the clarification. I think we may have one other potentially blocking issue. I&apos;ll let you know when I get into the next sprint (later today/this week).&lt;/p&gt;</comment>
                            <comment id="294037" author="craiggwilson" created="Wed, 20 Mar 2013 16:19:12 +0000"  >&lt;p&gt;Just to note... This problem only exists for lambdas applied to a class with a constraint where the implementation contains a different number of accessors than the interface.  That was a mouthful, so as to your example...  Because IIdentity.Id only has a getter, but your implementation JobHistory.Id has a getter and a setter, we are having an issue.  Hence, if this is the only location that type of thing occurs, you are probably ok (and we&apos;d like to know if you hit any other regressions; this was a major release).&lt;/p&gt;

&lt;p&gt;In previous versions of the driver, this worked by accident, so we were a little surprised it worked at all when the report came in.  &lt;/p&gt;</comment>
                            <comment id="294032" author="bniemyjski" created="Wed, 20 Mar 2013 16:12:31 +0000"  >&lt;p&gt;Thanks for the work around, I may wait this one out for a 1.8.1 as we have a ton of code uses lhamdas for setting representation and member names.&lt;/p&gt;</comment>
                            <comment id="294025" author="craiggwilson" created="Wed, 20 Mar 2013 16:09:25 +0000"  >&lt;p&gt;Ok, crappy workaround, but I think very safe in this case is to use a string instead of the lambda expression.  It&apos;s unlikely you&apos;ll change the Id member name in your IIdentity interface.&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;        void ConfigureClassMap&amp;lt;T&amp;gt;(BsonClassMap&amp;lt;T&amp;gt; cm)&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;            where T : class, IIdentity, new()&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;            cm.SetIdMember(cm.GetMemberMap(&quot;Id&quot;).SetRepresentation(BsonType.ObjectId));&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;Let me know if this is satisfactory in the mean time and we&apos;ll get this fixed for the next release.&lt;/p&gt;</comment>
                            <comment id="294009" author="craiggwilson" created="Wed, 20 Mar 2013 16:00:40 +0000"  >&lt;p&gt;I can confirm this is a regression.  I&apos;ll work to figure out a simple workaround and post back.  &lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="57849">CSHARP-637</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <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|hrmtrj:</customfieldvalue>

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