<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:37:38 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-716] Add support for serializing type Tuple introduced in .NET Framework 4</title>
                <link>https://jira.mongodb.org/browse/CSHARP-716</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;I have a c# Fund class with a property of type Dictionary&amp;lt;Tuple&amp;lt;int,DateTime&amp;gt;, int&amp;gt; called Quartiles.  I added a number of Fund objects to a collection in mongodb called &quot;funds&quot;.  They were added without any errors.  I then attempted to read back the fund documents from the collection.  I got an error trying to access the first document in the collection.  The error message said there was a problem serializing the Quartiles property and that an item with the same key had already been added.  I then attempted to inspect a sample Fund document using the mongo shell and it looks like it wasn&apos;t created properly.&lt;/p&gt;

&lt;p&gt;All relevant information is attached.&lt;/p&gt;</description>
                <environment>Windows 7 64-bit</environment>
        <key id="70107">CSHARP-716</key>
            <summary>Add support for serializing type Tuple introduced in .NET Framework 4</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="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="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="mryhmln">Mary Hamlin</reporter>
                        <labels>
                    </labels>
                <created>Thu, 28 Mar 2013 20:30:12 +0000</created>
                <updated>Thu, 2 Apr 2015 18:05:55 +0000</updated>
                            <resolved>Wed, 10 Sep 2014 19:32:17 +0000</resolved>
                                    <version>1.8</version>
                                    <fixVersion>2.0</fixVersion>
                                                        <votes>1</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="716103" author="xgen-internal-githook" created="Wed, 10 Sep 2014 19:31:43 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;rstam&apos;, u&apos;name&apos;: u&apos;rstam&apos;, u&apos;email&apos;: u&apos;robert@robertstam.org&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-716&quot; title=&quot;Add support for serializing type Tuple introduced in .NET Framework 4&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-716&quot;&gt;&lt;del&gt;CSHARP-716&lt;/del&gt;&lt;/a&gt;: Renamed TupleSerializer field names and added public properties for the ItemSerializers.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/032385f26fa134b73e85940432529bb918283918&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/032385f26fa134b73e85940432529bb918283918&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="716102" author="xgen-internal-githook" created="Wed, 10 Sep 2014 19:31:41 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;rstam&apos;, u&apos;name&apos;: u&apos;rstam&apos;, u&apos;email&apos;: u&apos;robert@robertstam.org&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-716&quot; title=&quot;Add support for serializing type Tuple introduced in .NET Framework 4&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-716&quot;&gt;&lt;del&gt;CSHARP-716&lt;/del&gt;&lt;/a&gt;: Add serializers for .NET&apos;s Tuple types.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/1950146eb1a5512435993f0eb5f09b1edfa8a2ba&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/1950146eb1a5512435993f0eb5f09b1edfa8a2ba&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="302702" author="rstam" created="Sun, 31 Mar 2013 14:35:20 +0000"  >&lt;p&gt;This issue depends on &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-625&quot; title=&quot;Make .NET Framework 4 the minimum requirement for the C# driver&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-625&quot;&gt;&lt;del&gt;CSHARP-625&lt;/del&gt;&lt;/a&gt; because we can&apos;t add serializers for .NET Framework 4 specific types until we make .NET Framework 4 the minimum required framework version for the C# driver.&lt;/p&gt;</comment>
                            <comment id="302290" author="rstam" created="Sat, 30 Mar 2013 15:25:59 +0000"  >&lt;p&gt;One note about the sample TupleSerializer: it stores the items of the tuple in a BSON array.&lt;/p&gt;

&lt;p&gt;That seemed like the most natural representation of a Tuple in a BSON document, although other representations are possible. For example, a Tuple could also have been represented as an embedded document instead of an array:&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;   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;{ Item1 : value1, Item2 : value2 }&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;Which in some cases might be a better representation (depending on what sort of queries you write and how you might want to index your documents). The sample TupleSerializer could be modified to use this representation instead.&lt;/p&gt;</comment>
                            <comment id="302288" author="rstam" created="Sat, 30 Mar 2013 15:19:48 +0000"  >&lt;p&gt;While the driver itself can&apos;t yet support serializing .NET Framework 4 types, there is nothing preventing a custom serializer being registered for them. I&apos;m attaching a sample serializer for Tuple&amp;lt;T1, T2&amp;gt; that you  could incorporate into your application to make serialization of Tuple&amp;lt;T1, T2&amp;gt; work with the current version of the driver (see the attached TupleSerializer.cs file). This serializer will work with any types T1 and T2 as long as T1 and T2 are themselves properly serializable.&lt;/p&gt;

&lt;p&gt;In order for this serializer to be available you must register it as follows:&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;   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;BsonSerializer.RegisterGenericSerializerDefinition(typeof(Tuple&amp;lt;,&amp;gt;), typeof(TupleSerializer&amp;lt;,&amp;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;You must register serializers as early as possible in the lifecycle of your application. At the very least the serializer must be registered before any attempt is made to serialize or deserialize a Tuple.&lt;/p&gt;

&lt;p&gt;This serializer could be modified slightly to create new serializers for other Tuples of different cardinality.&lt;/p&gt;</comment>
                            <comment id="302277" author="rstam" created="Sat, 30 Mar 2013 14:44:35 +0000"  >&lt;p&gt;Version 1.8 of the C# driver is built against .NET Framework 3.5. While it can be used with applications that target .NET Framework 4, it does not have built-in serializers for types, like Tuple, that were introduced in .NET Framework 4.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="55297">CSHARP-625</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="25481" name="TupleSerializer.cs" size="1518" author="robert@mongodb.com" created="Sat, 30 Mar 2013 15:20:24 +0000"/>
                            <attachment id="25450" name="c-sharp driver bug.txt" size="12275" author="mryhmln" created="Thu, 28 Mar 2013 20:30:13 +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|hrh3gv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>13358</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="131">Sprint 2</customfieldvalue>
    <customfieldvalue id="262">C# Sprint 8</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>