<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:44:31 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-3149] Error in Auto class map with constructor parameter mismatch</title>
                <link>https://jira.mongodb.org/browse/CSHARP-3149</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;If you create a C# class with a property of type array and the constructor accepts an IEnumerable for that parameter the driver is not able to map the class.&lt;/p&gt;

&lt;p&gt;Attached program that raises the exception. But basically here is the problem, this class triggers the error&lt;/p&gt;

&lt;p&gt;public class TestArray&lt;br/&gt;
 {&lt;br/&gt;
 public TestArray(String id, IEnumerable&amp;lt;String&amp;gt; values)&lt;/p&gt;
 {
 Id = id;
 Values = values.ToArray();
 }

&lt;p&gt;public String Id { get; private set; }&lt;/p&gt;

&lt;p&gt;public String[] Values { get; private set; }&lt;br/&gt;
 }&lt;/p&gt;

&lt;p&gt;This happens because the constructor accepts a parameter vlaues THAT HAS THE SAME NAME OF A PROPERTY BUT DIFFERENT TYPE, this generates the exception.&lt;/p&gt;

&lt;p&gt;Also the error is not present if properties setters are public (because the mapper directly map properties).&#160;&lt;/p&gt;

&lt;p&gt;Actually this is a serious bug, I&apos;ve updated driver on a project of mine and I have tons of test failing for such classes.&lt;/p&gt;

&lt;p&gt;Everything was fine with 2.7 driver.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1400000">CSHARP-3149</key>
            <summary>Error in Auto class map with constructor parameter mismatch</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="13202">Works as Designed</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="alkampfer@nablasoft.com">Gian Maria Ricci</reporter>
                        <labels>
                    </labels>
                <created>Thu, 2 Jul 2020 13:55:21 +0000</created>
                <updated>Fri, 27 Oct 2023 13:24:51 +0000</updated>
                            <resolved>Mon, 13 Jul 2020 14:49:22 +0000</resolved>
                                    <version>2.10.4</version>
                                                    <component>Serialization</component>
                                        <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="3282167" author="esha.bhargava" created="Mon, 13 Jul 2020 14:49:14 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=alkampfer&quot; class=&quot;user-hover&quot; rel=&quot;alkampfer&quot;&gt;alkampfer&lt;/a&gt; Thanks! Closing this as works as designed.&lt;/p&gt;</comment>
                            <comment id="3269744" author="JIRAUSER1269368" created="Fri, 3 Jul 2020 11:20:23 +0000"  >&lt;p&gt;Yes, I&apos;ve already fixed my code. I think that the bug can be closed with a not in Release Notes as breaking changes for the driver.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Actually moving from 2.7 to 2.10 should be a no brainer because I did not find any breaking changes in release notes, but I think this is a breaking changes that should be somewhat documented.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Thanks.&lt;/p&gt;</comment>
                            <comment id="3268349" author="dmitry.lukyanov" created="Thu, 2 Jul 2020 14:10:29 +0000"  >&lt;p&gt;Hello &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=alkampfer&quot; class=&quot;user-hover&quot; rel=&quot;alkampfer&quot;&gt;alkampfer&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Thanks for your report, try to use the same type for &lt;em&gt;Values&lt;/em&gt; property and &lt;em&gt;value&lt;/em&gt; ctor argument (either &lt;em&gt;string[]&lt;/em&gt; or &lt;em&gt;Ienumerable&amp;lt;string&amp;gt;&lt;/em&gt; in both cases). Currently, we recognize this case as an immutable class that has a bit different processing. See this comment for details: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-2889?focusedCommentId=3212482&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-3212482&quot; class=&quot;external-link&quot; rel=&quot;nofollow&quot;&gt;https://jira.mongodb.org/browse/CSHARP-2889?focusedCommentId=3212482&amp;amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-3212482&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="268334" name="Program.cs" size="993" author="alkampfer" created="Thu, 2 Jul 2020 13:53:00 +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|hxg4pb:</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>