Skip to content

Separate FromSql methods into 2 methods - #15018

Merged
smitpatel merged 1 commit into
masterfrom
smit/FromSql10996
Mar 14, 2019
Merged

smitpatel merged 1 commit into
masterfrom
smit/FromSql10996

Conversation

@smitpatel

Copy link
Copy Markdown
Contributor

Resolves #10996

New methods:
FromRawSql/ExecuteRawSql(Async) - works with string, parameters
FromInterpolatedSql/ExecuteInterpolatedSql(Async) - works with FormattableString

Deprecated old methods & RawSqlString

@smitpatel
smitpatel requested review from ajcvickers and divega March 13, 2019 19:24
Comment thread src/EFCore.Relational/RawSqlString.cs Resolved

@divega divega left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I am done with the Obsolete messages and reviewing the XML docs. Just in case there are concerns with them, this is my reasoning:

Given that the goal of the change is to address confusion, customers that hit the obsolete warning may already be using the wrong overload. Then we want to present the decision point every time, so that they can pick the right method depending on what they want/expect from the API.

Let me know what you think.

Comment thread src/EFCore.Relational/RawSqlString.cs Resolved
/// <returns>
/// A task that represents the asynchronous operation. The task result is the number of rows affected.
/// </returns>
public static Task<int> ExecuteRawSqlAsync(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I will create a new issue about using ValueTask on our APIs.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we need more methods (for more return types) how are we going to name them?! :trollface:

Resolves #10996

New methods:
FromRawSql/ExecuteRawSql(Async) - works with string, parameters
FromInterpolatedSql/ExecuteInterpolatedSql(Async) - works with FormattableString

Deprecated old methods & RawSqlString
@ajcvickers

Copy link
Copy Markdown
Contributor

Good messages! :-)

@smitpatel
smitpatel merged commit a999c41 into master Mar 14, 2019
@smitpatel
smitpatel deleted the smit/FromSql10996 branch March 14, 2019 22:18
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.

3 participants