<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:39:48 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-1503] Can we mark IMongoQueryProvider as public?</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1503</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Would it be possible to have the IMongoQueryProvider interface (&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/blob/v2.2.0/src/MongoDB.Driver/Linq/IMongoQueryProvider.cs&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/blob/v2.2.0/src/MongoDB.Driver/Linq/IMongoQueryProvider.cs&lt;/a&gt;) marked as public?&lt;/p&gt;

&lt;p&gt;We are building a Framework that has built-in Async LINQ support, and for our mongodb data adapter it would make for extremely cleaner code if we could access ExecuteAsync&amp;lt;T&amp;gt; directly, instead of having to rewrite all the CountAsync, SumAsync etc (that are already coded inside the core of our framework).&lt;/p&gt;

&lt;p&gt;This interface is well documented, and does not have any properties of types that are not exposed, so it seems to me that it can be easily changed to public. Of course that means keeping backwards compatibility on the API from now on, but I think it can be useful for users of the C# driver in general to have access to it.&lt;/p&gt;</description>
                <environment></environment>
        <key id="243546">CSHARP-1503</key>
            <summary>Can we mark IMongoQueryProvider as public?</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="potz">Potiguar Faga</reporter>
                        <labels>
                    </labels>
                <created>Fri, 11 Dec 2015 20:40:08 +0000</created>
                <updated>Mon, 13 Sep 2021 16:31:34 +0000</updated>
                            <resolved>Mon, 13 Sep 2021 16:31:34 +0000</resolved>
                                    <version>2.2</version>
                                                    <component>Linq</component>
                                        <votes>1</votes>
                                    <watches>4</watches>
                                                                                                                <comments>
                            <comment id="4032353" author="dmitry.lukyanov" created="Tue, 31 Aug 2021 19:29:51 +0000"  >&lt;p&gt;Hi, &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=potz&quot; class=&quot;user-hover&quot; rel=&quot;potz&quot;&gt;potz&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Thank you for the provided suggestion, but we have decided not to accept it. Mocking a third-party library - such as the MongoDB .NET Driver - is considered an anti-pattern because it hides changes in the mocked behaviour. The generally accepted solution is to encapsulate the dependency behind your own interface, which you can then mock and integration test. There has been much written on this topic, but this blog post is a good start with references to additional resources on the topic:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://dev.to/satansdeer/dont-mock-what-you-dont-own-cd6&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://dev.to/satansdeer/dont-mock-what-you-dont-own-cd6&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If there is a particular problem that you are trying to solve that can&apos;t be solved using the encapsulation technique, please elaborate further as there may be other solutions to consider.&lt;/p&gt;

&lt;p&gt;Sincerely,&lt;br/&gt;
 MongoDB .NET Driver Team&lt;/p&gt;</comment>
                            <comment id="1856542" author="mcaroul" created="Thu, 5 Apr 2018 17:02:08 +0000"  >&lt;p&gt;+1 as Greg said, my choices are all bad too for unit testing.&lt;/p&gt;

&lt;p&gt;I guess that a new version of the driver will be released with mongodb v4.0.&lt;br/&gt;
Would it be possible to have a change about this ticket with it ? &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="1791707" author="tetious" created="Thu, 1 Feb 2018 14:26:31 +0000"  >&lt;p&gt;Any chance this could be changed soon? It is just one word (with implications beyond that, I realize. &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;) and will make testing around AsQueryable so much easier.&lt;/p&gt;

&lt;p&gt;Right now, my choices are all bad. I can either give up the niceties of IMongoQueryable (the async stuff, mostly), roll my own version of the driver, or skip testing any of my logic after an AsQueryable call.&lt;/p&gt;

&lt;p&gt;Note that the subject of this task should be changed, as it is about &lt;b&gt;IMongoQueryProvider&lt;/b&gt; not IMongoQueryable. &lt;/p&gt;</comment>
                            <comment id="1112542" author="potz" created="Fri, 11 Dec 2015 20:52:30 +0000"  >&lt;p&gt;Understood. Thanks for the quick answer. I can certainly use a custom-built version of the driver for now.&lt;/p&gt;</comment>
                            <comment id="1112531" author="craiggwilson" created="Fri, 11 Dec 2015 20:48:09 +0000"  >&lt;p&gt;Hi Potiguar,&lt;/p&gt;

&lt;p&gt;Thanks for the question. We&apos;ll certainly consider it. The reason it&apos;s not public currently is that we thought we might need to change this interface in the future if we were to transition over to Relinq (for instance). Give us some time to think it over and come up with an answer. It won&apos;t happen before 2.3.0 which is a little ways off (targeting .NET Core support for that release). Until then, I&apos;d suggest you build a custom version of the driver to ensure that simply making this public actually solves your needs. There might be other work that would need to occur internally if, for instance, your CountAsync method and ours don&apos;t play well together.&lt;/p&gt;

&lt;p&gt;Craig&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                                        </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|hr8ut3:</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>