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

Spatial: Translate GeometryType and OgcGeometryType #13469

Merged
merged 1 commit into from Oct 4, 2018
Merged

Spatial: Translate GeometryType and OgcGeometryType #13469

merged 1 commit into from Oct 4, 2018

Conversation

bricelam
Copy link
Contributor

@bricelam bricelam commented Oct 2, 2018

Fixes #13280

Providers, this adds a class for generating SQL CASE expressions.

/// Gets the static type of the expression that this <see cref="Expression"/> represents.
/// </summary>
/// <value> The <see cref="Type"/> that represents the static type of the expression. </value>
public override Type Type
Copy link
Member

Choose a reason for hiding this comment

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

Do we have a check for Empty WhenThenList?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will validate types too.

src/EFCore.Relational/Query/Expressions/CaseExpression.cs Outdated Show resolved Hide resolved
@bricelam
Copy link
Contributor Author

bricelam commented Oct 2, 2018

Updated. Checks for empty when list. Added type validation. Renamed WhenThen to CaseWhenClause.

/// <summary>
/// Gets the when operand expression.
/// </summary>
public virtual Expression Test { get; }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fun fact: The SQL spec actually allows for multiple tests, but I don't know of a database that implements it.

CASE Name
    WHEN 'Brice', 'BRICE', 'brice' THEN 'me'
END

<value>An else result type of '{elseResultType}' is invalid. The expected type is '{resultType}'.</value>
</data>
<data name="CaseWhenClauseResultTypeUnexpected" xml:space="preserve">
<value>A when result type of '{whenResultType}' is invalid. The expected type is '{resultType}'.</value>
Copy link
Contributor

Choose a reason for hiding this comment

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

"Result type of '{whenResultType}' ..." ? Using when as a noun seems bit weird (ESL though, so I might 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.

Will reword. Maybe something like "The result type 'blah' of a when clause..."

/// <summary>
/// Represents a SQL CASE expression.
/// </summary>
public class CaseExpression : Expression
Copy link
Contributor

Choose a reason for hiding this comment

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

also add IPrintable, for the pretty-printing hook

@bricelam bricelam merged commit c599721 into dotnet:release/2.2 Oct 4, 2018
@bricelam bricelam deleted the 2moar branch October 4, 2018 17:32
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.

None yet

4 participants