Skip to content

Commit

Permalink
Finish What's New in EF7
Browse files Browse the repository at this point in the history
  • Loading branch information
ajcvickers committed Oct 10, 2022
1 parent 61926f4 commit 6f89ed2
Show file tree
Hide file tree
Showing 8 changed files with 1,641 additions and 20 deletions.
2 changes: 1 addition & 1 deletion entity-framework/core/querying/sql-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The following example passes a single parameter to a stored procedure by includi

[!code-csharp[Main](../../../samples/core/Querying/SqlQueries/Program.cs#FromSqlStoredProcedureParameter)]

While this syntax may look like regular C# [string interpolation](https://learn.microsoft.com/dotnet/csharp/language-reference/tokens/interpolated), the supplied value is wrapped in a `DbParameter` and the generated parameter name inserted where the `{0}` placeholder was specified. This makes > The <xref:Microsoft.EntityFrameworkCore.RelationalQueryableExtensions.FromSql%2A> safe from SQL injection attacks, and sends the value efficiently and correctly to the database.
While this syntax may look like regular C# [string interpolation](/dotnet/csharp/language-reference/tokens/interpolated), the supplied value is wrapped in a `DbParameter` and the generated parameter name inserted where the `{0}` placeholder was specified. This makes > The <xref:Microsoft.EntityFrameworkCore.RelationalQueryableExtensions.FromSql%2A> safe from SQL injection attacks, and sends the value efficiently and correctly to the database.

When executing stored procedures, it can be useful to use named parameters in the SQL query string, especially when the stored procedure has optional parameters:

Expand Down
Loading

0 comments on commit 6f89ed2

Please sign in to comment.