<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:38:54 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-1183] Adding serialization info for custom serializer</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1183</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I have a class as follows:&lt;/p&gt;

&lt;p&gt;class Person&lt;br/&gt;
{&lt;br/&gt;
  public String Id &lt;/p&gt;
{ get; set; }&lt;br/&gt;
  public String Name { get; set; }
&lt;p&gt;  public Person Mother &lt;/p&gt;
{ get; set; }
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;I&apos;ve implemented a custom serializer for the Mother property to serialize the Id only. The final BSON would look something like this:&lt;/p&gt;

&lt;p&gt;[{ &quot;_id&quot;: &quot;54df1095fa0bd7122cb2c550&quot;, &quot;name&quot;: &quot;John&quot;, &quot;mother&quot;: &lt;/p&gt;
{ &quot;_id&quot;: &quot;54df1095fa0bd7122cb2c551&quot; }
&lt;p&gt; } ...]&lt;/p&gt;

&lt;p&gt;If I try to execute a query to find a person with a given mother as follow:&lt;/p&gt;

&lt;p&gt;var results = await collection.Find&amp;lt;Person&amp;gt; (p =&amp;gt; p.Mother.Id == &quot;...&quot;).ToListAsync ();&lt;/p&gt;

&lt;p&gt;The driver complains with the following:&lt;/p&gt;

{&quot;Unable to determine the serialization information for the expression: p.Mother.Id.&quot;}

&lt;p&gt;Is there a way to add serialization info to the driver so it knows to call my custom serializer to deserialize Person for this type of query?&lt;/p&gt;</description>
                <environment></environment>
        <key id="184340">CSHARP-1183</key>
            <summary>Adding serialization info for custom serializer</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="-1">Unassigned</assignee>
                                    <reporter username="gjdownes">Graeme Downes</reporter>
                        <labels>
                            <label>c#</label>
                            <label>custom</label>
                            <label>linq,query</label>
                            <label>question</label>
                            <label>serialization</label>
                    </labels>
                <created>Sat, 14 Feb 2015 09:43:38 +0000</created>
                <updated>Fri, 5 Apr 2019 13:59:05 +0000</updated>
                            <resolved>Sat, 14 Feb 2015 13:56:36 +0000</resolved>
                                    <version>2.0</version>
                                                    <component>BSON</component>
                    <component>Linq</component>
                    <component>Serialization</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="829486" author="gjdownes" created="Sat, 14 Feb 2015 15:24:05 +0000"  >&lt;p&gt;Thanks. Apologies for the spam. I&apos;ll post my questions there exclusively from now on.&lt;/p&gt;</comment>
                            <comment id="829471" author="craiggwilson" created="Sat, 14 Feb 2015 13:56:36 +0000"  >&lt;p&gt;I see that you&apos;ve asked this on StackOverflow as well. Since we normally reserve JIRA for bug reports and feature requests, I&apos;ll go ahead and answer this question there.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://stackoverflow.com/questions/28514352/adding-serialization-information-for-mongodb-custom-serializer&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://stackoverflow.com/questions/28514352/adding-serialization-information-for-mongodb-custom-serializer&lt;/a&gt;&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|hs6bcn:</customfieldvalue>

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