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

Document new FromSql{Raw,Interpolated} methods #1673

Merged
merged 1 commit into from
Sep 20, 2019
Merged

Document new FromSql{Raw,Interpolated} methods #1673

merged 1 commit into from
Sep 20, 2019

Conversation

roji
Copy link
Member

@roji roji commented Aug 26, 2019

Closes #1667

Copy link
Contributor

@divega divega left a comment

Choose a reason for hiding this comment

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

Comments on several things that I believe need fixing. Also, you may want to consider fixing #665 (at least the part about ExecuteSqlCommand and its modern siblings) while you are are this. It should be low hanging fruit once the docs for FromSqlRaw and FromSqlIterpolated are complete.

entity-framework/core/querying/raw-sql.md Outdated Show resolved Hide resolved
entity-framework/core/querying/raw-sql.md Outdated Show resolved Hide resolved
entity-framework/core/querying/raw-sql.md Outdated Show resolved Hide resolved
entity-framework/core/querying/raw-sql.md Outdated Show resolved Hide resolved
entity-framework/core/querying/raw-sql.md Show resolved Hide resolved
entity-framework/core/querying/raw-sql.md Outdated Show resolved Hide resolved
samples/core/Querying/Querying/RawSQL/Sample.cs Outdated Show resolved Hide resolved
@divega
Copy link
Contributor

divega commented Aug 30, 2019

@roji #1132 may also be easy to address.

@roji roji force-pushed the fromsql branch 2 times, most recently from 02b375f to df55caa Compare September 2, 2019 14:09
@roji
Copy link
Member Author

roji commented Sep 2, 2019

Thanks for the reviews @divega and @smitpatel, I realized that my mental model of FromSql wasn't very accurate. Have rewritten the change, hopefully things are better now.

Copy link
Contributor

@divega divega left a comment

Choose a reason for hiding this comment

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

LGTM. @roji, sorry it took me some time to come back to this PR.

entity-framework/core/querying/raw-sql.md Outdated Show resolved Hide resolved
entity-framework/core/querying/raw-sql.md Show resolved Hide resolved
@@ -7,19 +7,19 @@ uid: core/querying/raw-sql
---
# Raw SQL Queries

Entity Framework Core allows you to drop down to raw SQL queries when working with a relational database. This can be useful if the query you want to perform can't be expressed using LINQ, or if using a LINQ query is resulting in inefficient SQL queries. Raw SQL queries can return entity types or, starting with EF Core 2.1, [query types](xref:core/modeling/query-types) that are part of your model.
Entity Framework Core allows you to drop down to raw SQL queries when working with a relational database. This can be useful if the query you want to perform can't be expressed using LINQ, or if using a LINQ query is resulting in inefficient SQL queries. Raw SQL queries can be used to return any entities that are part of your model, including regular entities and [keyless entitties](xref:core/modeling/query-types).
Copy link
Contributor

Choose a reason for hiding this comment

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

an inefficient SQL query.

Copy link
Contributor

Choose a reason for hiding this comment

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

any entity types which are included in the model.

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand entity as the instance and entitytype as the object's type.

Copy link
Member Author

Choose a reason for hiding this comment

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

I understand entity as the instance and entitytype as the object's type.

I also understand it this way, but I think it makes sense to specify the type here, as we're discussing the type of the type (regular vs. keyless). A bit like how we say that a C# method return value or reference types (and not necessarily value or reference values).

Copy link
Contributor

Choose a reason for hiding this comment

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

Also renamed page here.

entity-framework/core/querying/raw-sql.md Show resolved Hide resolved
entity-framework/core/querying/raw-sql.md Show resolved Hide resolved
@roji roji merged commit b506817 into master Sep 20, 2019
@roji
Copy link
Member Author

roji commented Sep 20, 2019

Have taken comments into account and merged. There's definitely still stuff to be improved here, we can always do it later.

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.

Why the example subject to SQL Injection attack?
4 participants