<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:35:43 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-70] Deserializing a public property with a private setter</title>
                <link>https://jira.mongodb.org/browse/CSHARP-70</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;A public property with a private setter will throw. E.g:: &lt;/p&gt;

&lt;p&gt;public IList&amp;lt;EventSession&amp;gt; Sessions &lt;/p&gt;
{ get; private set; }

&lt;p&gt;Error is occurring   inBsonPropertyMapper.cs line 226 because call to propertyInfo.GetSetmethod() is throwing.&lt;/p&gt;

&lt;p&gt;        public override Action&amp;lt;object, object&amp;gt; Setter {&lt;br/&gt;
            get {&lt;br/&gt;
                if (setter == null) &lt;/p&gt;
{
                    var setMethodInfo = propertyInfo.GetSetMethod();   // This throws
                    var setMethodDelegate = (Action&amp;lt;TClass, TProperty&amp;gt;) Delegate.CreateDelegate(typeof(Action&amp;lt;TClass, TProperty&amp;gt;), setMethodInfo);
                    setter = (obj, value) =&amp;gt; setMethodDelegate((TClass) obj, (TProperty) value);
                }
&lt;p&gt;                return setter;&lt;br/&gt;
            }&lt;br/&gt;
        }&lt;/p&gt;</description>
                <environment>All</environment>
        <key id="13391">CSHARP-70</key>
            <summary>Deserializing a public property with a private setter</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="craig.wilson@mongodb.com">Craig Wilson</assignee>
                                    <reporter username="zippy1981">Justin Dearing</reporter>
                        <labels>
                    </labels>
                <created>Fri, 15 Oct 2010 22:29:20 +0000</created>
                <updated>Thu, 20 Mar 2014 14:30:04 +0000</updated>
                            <resolved>Wed, 27 Oct 2010 20:11:03 +0000</resolved>
                                    <version>0.5</version>
                                                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="19723" author="craiggwilson" created="Wed, 27 Oct 2010 20:11:03 +0000"  >&lt;p&gt;fixed.&lt;/p&gt;</comment>
                            <comment id="19346" author="lanwin" created="Tue, 19 Oct 2010 17:44:05 +0000"  >&lt;p&gt;Sorry wrong driver.&lt;/p&gt;</comment>
                            <comment id="19286" author="zippy1981" created="Mon, 18 Oct 2010 10:53:27 +0000"  >&lt;p&gt;Steve,&lt;/p&gt;

&lt;p&gt;Thanks for the workaround, but are you against my patch?&lt;/p&gt;

&lt;p&gt;Justin&lt;/p&gt;</comment>
                            <comment id="19284" author="lanwin" created="Mon, 18 Oct 2010 04:22:08 +0000"  >&lt;p&gt;You can use a protected setter instead. Which will work with the current codebase.&lt;/p&gt;</comment>
                            <comment id="19252" author="zippy1981" created="Sat, 16 Oct 2010 13:43:22 +0000"  >&lt;p&gt;With same one line fix with unit tests:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://github.com/zippy1981/mongo-csharp-driver/commit/5960cb6e0ada0c8df4ccf7f8471bccdce28def46&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://github.com/zippy1981/mongo-csharp-driver/commit/5960cb6e0ada0c8df4ccf7f8471bccdce28def46&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="19246" author="zippy1981" created="Fri, 15 Oct 2010 22:42:14 +0000"  >&lt;p&gt;One line fix:&lt;/p&gt;

&lt;p&gt;var setMethodInfo = propertyInfo.GetSetMethod(true);&lt;/p&gt;

&lt;p&gt;Quality is &quot;works for me&quot; but unit tests remain green&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|hrh9vb:</customfieldvalue>

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