<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:41:03 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-1916] Ability to have 2 different serialization configuration within the same process</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1916</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I have a POCO object (ClassA) that is configured with certain Bson attributes for class and properties. Of cause when I save an instance of it to the DB, driver honers all attributes.&lt;/p&gt;

&lt;p&gt;I have another object that is declared as:&lt;br/&gt;
public class EventData&lt;br/&gt;
{&lt;br/&gt;
     public Guid Id &lt;/p&gt;
{get; set;}
&lt;p&gt;     &lt;span class=&quot;error&quot;&gt;&amp;#91;BsonElement&amp;#93;&lt;/span&gt;&lt;br/&gt;
     public dynamic Details &lt;/p&gt;
{get;set;}
&lt;p&gt;}&lt;br/&gt;
I assign ClassA instance to the Details property of the EventData. When I save the EventData to the DB, driver attaches &quot;_t&quot; element as well follows all Bson attributes that ClassA declares, including property name aliases, etc. &lt;br/&gt;
I would like that when ClassA is being saved on its own, driver follows all instructions the Bson attributes provide, but when ClassA is being saved as part of EventData, driver should ignore the Bson attributes declared in ClassA.&lt;/p&gt;

&lt;p&gt;This is similar to providing multiple Property names resolvers to JSON.NET...&lt;/p&gt;

&lt;p&gt;Is this possible to do? If so, how would I do this? Do you plan to add this capability if not yet available? &lt;/p&gt;</description>
                <environment></environment>
        <key id="353405">CSHARP-1916</key>
            <summary>Ability to have 2 different serialization configuration within the same process</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="lennygran">Lenny Granovsky</reporter>
                        <labels>
                            <label>question</label>
                    </labels>
                <created>Sun, 12 Feb 2017 20:51:16 +0000</created>
                <updated>Thu, 31 Mar 2022 00:33:22 +0000</updated>
                                            <version>2.4</version>
                                                    <component>Configuration</component>
                    <component>Serialization</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1553246" author="lennygran" created="Thu, 20 Apr 2017 00:40:14 +0000"  >&lt;p&gt;Since I didn&apos;t get response for last comment, I would like to rephrase it: is it possible to provide an option to ignore all Bson attributes by passing special config parameter into serialization context? &lt;br/&gt;
The business case I&apos;m trying to address is to be able to save .net class with Bson attributes into DB, and then read the same document as dynamic type in a such a way that object structure would be the same regardless whether class type or dynamic was used for read operation.&lt;/p&gt;</comment>
                            <comment id="1514948" author="lennygran" created="Thu, 2 Mar 2017 23:49:35 +0000"  >&lt;p&gt;Maybe it would be possible from simpler option to &quot;ignore serialization Bson attributes&quot;? This would provide lots of help already.&lt;/p&gt;</comment>
                            <comment id="1514393" author="rstam" created="Thu, 2 Mar 2017 15:04:29 +0000"  >&lt;p&gt;We have talked about the possibility of supporting multiple simultaneous serialization configurations, but it is difficult to do, so for the foreseeable future it is unlikely that we will be able to do this.&lt;/p&gt;</comment>
                            <comment id="1497405" author="lennygran" created="Sun, 12 Feb 2017 20:54:45 +0000"  >&lt;p&gt;I would like to add that this is essentially equivalent of an option to enforce ignoring all attributes for sub-classes under &quot;dynamic&quot; typed property when saving to DB.&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|hsuwjj:</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>