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

Query: Add support for instance based SqlFunction #10370

Merged
merged 1 commit into from
Nov 29, 2017
Merged

Conversation

smitpatel
Copy link
Contributor

Part of #10109

@@ -1348,6 +1363,7 @@ public virtual Expression VisitSqlFunction(SqlFunctionExpression sqlFunctionExpr
/// <param name="functionName">The function name</param>
/// <param name="arguments">The function arguments</param>
/// <param name="schema">The function schema</param>
[Obsolete("Override VisitSqlFunction method instead.")]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added obsolete to avoid breaks. (3 of them in this file)
It was dead and obscure coding style. Only providers would be overriding them.
Break or obsolete?

@smitpatel smitpatel changed the base branch from dev to smit/defaultsqlgen November 23, 2017 00:16
@@ -16,7 +16,7 @@ namespace Microsoft.EntityFrameworkCore.Query.Expressions
/// <summary>
/// Represents a SQL function call expression.
/// </summary>
[DebuggerDisplay("{this.FunctionName}({string.Join(\", \", this.Arguments)})")]
[DebuggerDisplay("{this.Instance}.{this.FunctionName}({string.Join(\", \", this.Arguments)})")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Make helper method and call so you can handle null Instance case?

@anpete
Copy link
Contributor

anpete commented Nov 27, 2017

We ideally want some test coverage for this. The problem is that we need a "non-static" function to call on the server. One thing we could do is create a test method call translator that binds to some non-existent store function. We could then swallow the execution error but at least be able to verify the SQL.

cc @ajcvickers

@smitpatel smitpatel changed the base branch from smit/defaultsqlgen to dev November 27, 2017 22:25
@smitpatel smitpatel merged commit 6281180 into dev Nov 29, 2017
smitpatel added a commit that referenced this pull request Nov 29, 2017
Issue was fixed in #10370
VisitChildren method was incorrect

This adds test for the scenario

Resolves #10421
smitpatel added a commit that referenced this pull request Nov 29, 2017
Issue was fixed in #10370
VisitChildren method was incorrect

This adds test for the scenario

Resolves #10421
@smitpatel smitpatel deleted the smit/functions branch November 29, 2017 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants