Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSHARP-5473: Provide API to turn LINQ expression into MQL. #1601

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rstam
Copy link
Contributor

@rstam rstam commented Jan 25, 2025

The BIG question for this PR is whether we want to do this at all, and if so what the public API should be.

@rstam rstam requested a review from a team as a code owner January 25, 2025 21:15
public class CSharp5473Tests : Linq3IntegrationTest
{
[Fact]
public void Select_decimal_divide_should_work()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor : Test method name seems to be wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

var stages = provider.Translate(queryable, out var outputSerializer);
AssertStages(stages, "{ $project : { _v : { $add : ['$X', 1] }, _id : 0 } }");

var result = queryable.First();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we try to execute translated MQL in some way instead to make sure the translation was done properly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but not necessarily to verify that the translation was done correctly.

I'm more interested in showing HOW you could execute the result of Translate.

@rstam rstam requested a review from sanych-sun January 29, 2025 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants