<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:39: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-1444] LinqToMongo.Inject throws InvalidOperationException</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1444</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;The attached code throws an InvalidOperationException() The LinqToMongo.Inject method is only intended to be used in LINQ Where clauses.&lt;/p&gt;

&lt;p&gt;var point = new GeoJsonPoint&amp;lt;GeoJson2DGeographicCoordinates&amp;gt;(new GeoJson2DGeographicCoordinates(10, 10));&lt;br/&gt;
IMongoQuery query = Query&amp;lt;TestClass&amp;gt;.GeoIntersects(o =&amp;gt; o.Coord, point);&lt;br/&gt;
var result = objectsCollection.AsQueryable().Where(x =&amp;gt; query.Inject()).ToList(); // exception thrown here&lt;/p&gt;

&lt;p&gt;In version 1.9.2 of c# driver this code was worked. I use LINQ Where. Why exception was thrown?&lt;/p&gt;</description>
                <environment>Window 8 64 bit</environment>
        <key id="234457">CSHARP-1444</key>
            <summary>LinqToMongo.Inject throws InvalidOperationException</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="1" iconUrl="https://jira.mongodb.org/images/icons/priorities/blocker.svg">Blocker - P1</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="IlyaK">Ilya</reporter>
                        <labels>
                            <label>question</label>
                    </labels>
                <created>Thu, 15 Oct 2015 10:32:00 +0000</created>
                <updated>Fri, 5 Apr 2019 13:59:40 +0000</updated>
                            <resolved>Thu, 15 Oct 2015 18:47:17 +0000</resolved>
                                    <version>2.0.1</version>
                                                    <component>Linq</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="1061977" author="craiggwilson" created="Thu, 15 Oct 2015 18:47:18 +0000"  >&lt;p&gt;I&apos;m going to close this one as we will not support the old Query builder injection. However, I have opened up a feature request for this type of thing using the new builders in &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-1445&quot; title=&quot;Support arbitrary filters  in the LINQ provider.&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-1445&quot;&gt;&lt;del&gt;CSHARP-1445&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="1061971" author="ilyak" created="Thu, 15 Oct 2015 18:43:50 +0000"  >&lt;p&gt;Sorry, version is 2.1.0-rc1. Thanks for your answer.&lt;/p&gt;</comment>
                            <comment id="1061831" author="craiggwilson" created="Thu, 15 Oct 2015 17:17:28 +0000"  >&lt;p&gt;Hi ilya,&lt;/p&gt;

&lt;p&gt;You&apos;ve stated that the affects version is 2.0.1. This version does not support LINQ. Can you double check the version of the driver you are actually using. We&apos;ve introduced LINQ back in the 2.1 release (which is currently in rc1) but it will not support this syntax.&lt;/p&gt;

&lt;p&gt;Craig&lt;/p&gt;</comment>
                            <comment id="1061370" author="ilyak" created="Thu, 15 Oct 2015 12:57:51 +0000"  >&lt;p&gt;Hello. Added file with sample.&lt;/p&gt;</comment>
                            <comment id="1061335" author="craiggwilson" created="Thu, 15 Oct 2015 11:52:58 +0000"  >&lt;p&gt;Hi ilya,&lt;/p&gt;

&lt;p&gt;We have a great number of tests that exercise this bit of code. Could you provide a sample console program that causes this to occur?&lt;/p&gt;

&lt;p&gt;Thanks,&lt;br/&gt;
Craig&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="234583">CSHARP-1445</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="94191" name="Program.cs" size="4280" author="IlyaK" created="Thu, 15 Oct 2015 12:57:03 +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|hsdpon:</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>