<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:39:08 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-1275] Projection by expression where members are in base class throw exception</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1275</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;The following throws an exception in BsonClassMap, in one of the internal checks:&lt;/p&gt;

&lt;p&gt;public class SomeBaseType&lt;br/&gt;
{&lt;br/&gt;
  public int X &lt;/p&gt;
{get; set;}&lt;br/&gt;
}&lt;br/&gt;
&lt;br/&gt;
public class MyType : SomeBaseType&lt;br/&gt;
{&lt;br/&gt;
  public int Y {get; set;}
&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;_collection.AsQueryable().Select(collType =&amp;gt; new MyType &lt;/p&gt;
{ Y = collType.SomeField; }
&lt;p&gt;);&lt;/p&gt;

&lt;p&gt;Basically, if the projection expression attempts to populate a member not directly in the type being constructed.&lt;/p&gt;

&lt;p&gt;I will update this issue with more complete code and if possible a PR - just wanted to log it down before I forget.!&lt;/p&gt;</description>
                <environment></environment>
        <key id="203521">CSHARP-1275</key>
            <summary>Projection by expression where members are in base class throw exception</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="3">Duplicate</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="kierenj">Kieren Johnstone</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 May 2015 07:57:27 +0000</created>
                <updated>Mon, 22 Jun 2015 18:52:46 +0000</updated>
                            <resolved>Mon, 22 Jun 2015 18:52:30 +0000</resolved>
                                    <version>2.0</version>
                                                    <component>Linq</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="947280" author="craiggwilson" created="Mon, 22 Jun 2015 18:52:30 +0000"  >&lt;p&gt;This is a duplicate of &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-1253&quot; title=&quot;Cannot deserialize inherited members with aggregation queries (fluent API)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-1253&quot;&gt;&lt;del&gt;CSHARP-1253&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="911074" author="craiggwilson" created="Tue, 12 May 2015 11:39:29 +0000"  >&lt;p&gt;It&apos;s going to be in here: &lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/blob/master/src%2FMongoDB.Driver%2FLinq%2FProcessors%2FSerializerBuilder.cs#L95&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/blob/master/src%2FMongoDB.Driver%2FLinq%2FProcessors%2FSerializerBuilder.cs#L95&lt;/a&gt;. Somehow, we need to build the serializer starting with the base class. The issue we are dealing with here is this: Collection is of type A. User projects into type B. If type B contains mapping information already, it may or may not be accurate based on the source (type A). Hence, we need to build a new serializer for B with the information from A. So, what is happening in this case is that B has a base class and, because of how our class maps are built, we need to map both the base class and the super class.&lt;/p&gt;

&lt;p&gt;I think I had seen this with another bug report, but it got lost in the shuffle because it wasn&apos;t the main problem. This might or might not be fixable.&lt;/p&gt;

&lt;p&gt;Thanks for filing.&lt;br/&gt;
Craig&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="199520">CSHARP-1253</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <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|hs98tj:</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>