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

Make Microsoft docs link relative #3264

Merged
merged 1 commit into from
May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion entity-framework/core/extensions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Extends [Verify](https://github.com/VerifyTests/Verify) to allow snapshot testin

### LocalDb

Provides a wrapper around [SQL Server Express LocalDB](https://docs.microsoft.com/sql/database-engine/configure-windows/sql-server-express-localdb) to simplify running tests against Entity Framework. For EF Core: 3, 5.
Provides a wrapper around [SQL Server Express LocalDB](/sql/database-engine/configure-windows/sql-server-express-localdb) to simplify running tests against Entity Framework. For EF Core: 3, 5.

[GitHub repository](https://github.com/SimonCropp/LocalDb)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ EF Core reports metrics via the standard .NET event counters feature; it's recom

## Attach to a process using dotnet-counters

The [dotnet-counters tool](https://docs.microsoft.com/dotnet/core/diagnostics/dotnet-counters) can be used to attach to a running process and report EF Core event counters regularly; nothing special needs to be done in the program for these counters to be available.
The [dotnet-counters tool](/dotnet/core/diagnostics/dotnet-counters) can be used to attach to a running process and report EF Core event counters regularly; nothing special needs to be done in the program for these counters to be available.

First, install the `dotnet-counters` tool: `dotnet tool install --global dotnet-counters`.

Expand Down Expand Up @@ -81,4 +81,4 @@ SaveChanges | The number of times `SaveChanges` has be

## Additional resources

* [.NET documentation on event counters](https://docs.microsoft.com/dotnet/core/diagnostics/event-counters)
* [.NET documentation on event counters](/dotnet/core/diagnostics/event-counters)
2 changes: 1 addition & 1 deletion entity-framework/core/performance/performance-diagnosis.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ There are various alternatives to EF's logging feature for capturing command exe

For example, [SQL Server Management Studio](/sql/ssms/download-sql-server-management-studio-ssms) is a powerful client that can connect to your SQL Server instance and provide valuable management and performance information. It's beyond the scope of this section to go into the details, but two capabilities worth mentioning are the [Activity Monitor](/sql/relational-databases/performance-monitor/open-activity-monitor-sql-server-management-studio), which provides a live dashboard of server activity (including the most expensive queries), and the [Extended Events (XEvent)](/sql/relational-databases/extended-events/quick-start-extended-events-in-sql-server) feature, which allows defining arbitrary data capture sessions which can be tailored to your exact needs. [The SQL Server documentation on monitoring](/sql/relational-databases/performance/monitor-and-tune-for-performance) provides more information on these features, as well as others.

Another approach for capturing performance data is to collect information automatically emitted by either EF or the database driver via the `DiagnosticSource` interface, and then analyze that data or display it on a dashboard. If you are using Azure, then [Azure Application Insights](https://docs.microsoft.com/azure/azure-monitor/learn/tutorial-performance) provides such powerful monitoring out of the box, integrating database performance and query execution times in the analysis of how quickly your web requests are being served. More information on this is available in the [Application Insights performance tutorial](/azure/azure-monitor/learn/tutorial-performance), and in the [Azure SQL analytics page](/azure/azure-monitor/insights/azure-sql).
Another approach for capturing performance data is to collect information automatically emitted by either EF or the database driver via the `DiagnosticSource` interface, and then analyze that data or display it on a dashboard. If you are using Azure, then [Azure Application Insights](/azure/azure-monitor/learn/tutorial-performance) provides such powerful monitoring out of the box, integrating database performance and query execution times in the analysis of how quickly your web requests are being served. More information on this is available in the [Application Insights performance tutorial](/azure/azure-monitor/learn/tutorial-performance), and in the [Azure SQL analytics page](/azure/azure-monitor/insights/azure-sql).

## Inspecting query execution plans

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This page details value generation configuration and patterns that are specific

## IDENTITY columns

By convention, numeric columns that are configured to have their values generated on add are set up as [SQL Server IDENTITY columns](https://docs.microsoft.com/sql/t-sql/statements/create-table-transact-sql-identity-property).
By convention, numeric columns that are configured to have their values generated on add are set up as [SQL Server IDENTITY columns](/sql/t-sql/statements/create-table-transact-sql-identity-property).

### Seed and increment

Expand Down
4 changes: 2 additions & 2 deletions entity-framework/core/what-is-new/ef-core-5.0/whatsnew.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ For further information, [see the full documentation on collations and case sens

## Event counters

EF Core 5.0 exposes [event counters](https://devblogs.microsoft.com/dotnet/introducing-diagnostics-improvements-in-net-core-3-0) which can be used to track your application's performance and spot various anomalies. Simply attach to a process running EF with the [dotnet-counters](https://docs.microsoft.com/dotnet/core/diagnostics/dotnet-counters) tool:
EF Core 5.0 exposes [event counters](https://devblogs.microsoft.com/dotnet/introducing-diagnostics-improvements-in-net-core-3-0) which can be used to track your application's performance and spot various anomalies. Simply attach to a process running EF with the [dotnet-counters](/dotnet/core/diagnostics/dotnet-counters) tool:

```console
> dotnet counters monitor Microsoft.EntityFrameworkCore -p 49496
Expand Down Expand Up @@ -341,7 +341,7 @@ For further information, [see the full documentation on event counters](xref:cor
* Improved query translation around null semantics, resulting in tighter, more efficient queries.
* User-mapped functions can now be annotated to control null propagation, again resulting in tighter, more efficient queries.
* SQL containing CASE blocks is now considerably more concise.
* The SQL Server [`DATALENGTH`](https://docs.microsoft.com/sql/t-sql/functions/datalength-transact-sql) function can now be called in queries via the new [`EF.Functions.DataLength`](xref:Microsoft.EntityFrameworkCore.SqlServerDbFunctionsExtensions.DataLength%2A) method.
* The SQL Server [`DATALENGTH`](/sql/t-sql/functions/datalength-transact-sql) function can now be called in queries via the new [`EF.Functions.DataLength`](xref:Microsoft.EntityFrameworkCore.SqlServerDbFunctionsExtensions.DataLength%2A) method.
* `EnableDetailedErrors` adds [additional details to exceptions](xref:core/logging-events-diagnostics/simple-logging#detailed-query-exceptions).

### Saving
Expand Down
41 changes: 21 additions & 20 deletions entity-framework/ef6/modeling/designer/stored-procedures/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ ms.date: 10/23/2016
uid: ef6/modeling/designer/stored-procedures/query
---
# Designer Query Stored Procedures
This step-by-step walkthrough show how to use the Entity Framework Designer (EF Designer) to import stored procedures into a model and then call the imported stored procedures to retrieve results. 

This step-by-step walkthrough shows how to use the Entity Framework Designer (EF Designer) to import stored procedures into a model and then call the imported stored procedures to retrieve results.

Note, that Code First does not support mapping to stored procedures or functions. However, you can call stored procedures or functions by using the System.Data.Entity.DbSet.SqlQuery method. For example:
``` csharp

```csharp
var query = context.Products.SqlQuery("EXECUTE [dbo].[GetAllProducts]")`;
```

Expand All @@ -22,36 +24,36 @@ To complete this walkthrough, you will need:

## Set up the Project

- Open Visual Studio 2012.
- Select **File-> New -> Project**
- In the left pane, click **Visual C\#**, and then select the **Console** template.
- Enter **EFwithSProcsSample** as the name.
- Select **OK**.
- Open Visual Studio 2012.
- Select **File-> New -> Project**
- In the left pane, click **Visual C\#**, and then select the **Console** template.
- Enter **EFwithSProcsSample** as the name.
- Select **OK**.

## Create a Model

- Right-click the project in Solution Explorer and select **Add -> New Item**.
- Select **Data** from the left menu and then select **ADO.NET Entity Data Model** in the Templates pane.
- Enter **EFwithSProcsModel.edmx** for the file name, and then click **Add**.
- In the Choose Model Contents dialog box, select **Generate from database**, and then click **Next**.
- Click **New Connection**.
- Right-click the project in Solution Explorer and select **Add -> New Item**.
- Select **Data** from the left menu and then select **ADO.NET Entity Data Model** in the Templates pane.
- Enter **EFwithSProcsModel.edmx** for the file name, and then click **Add**.
- In the Choose Model Contents dialog box, select **Generate from database**, and then click **Next**.
- Click **New Connection**.
In the Connection Properties dialog box, enter the server name (for example, **(localdb)\\mssqllocaldb**), select the authentication method, type **School** for the database name, and then click **OK**.
The Choose Your Data Connection dialog box is updated with your database connection setting.
- In the Choose Your Database Objects dialog box, check the **Tables** checkbox to select all the tables.
Also, select the following stored procedures under the **Stored Procedures and Functions** node: **GetStudentGrades** and **GetDepartmentName**. 
- In the Choose Your Database Objects dialog box, check the **Tables** checkbox to select all the tables.
Also, select the following stored procedures under the **Stored Procedures and Functions** node: **GetStudentGrades** and **GetDepartmentName**.

![Import Stored Procedures](~/ef6/media/import.jpg)

*Starting with Visual Studio 2012 the EF Designer supports bulk import of stored procedures. The **Import selected stored procedures and functions into theentity model** is checked by default.*
- Click **Finish**.
- Click **Finish**.

By default, the result shape of each imported stored procedure or function that returns more than one column will automatically become a new complex type. In this example we want to map the results of the **GetStudentGrades** function to the **StudentGrade** entity and the results of the **GetDepartmentName** to **none** (**none** is the default value).

For a function import to return an entity type, the columns returned by the corresponding stored procedure must exactly match the scalar properties of the returned entity type. A function import can also return collections of simple types, complex types, or no value.

- Right-click the design surface and select **Model Browser**.
- In **Model Browser**, select **Function Imports**, and then double-click the **GetStudentGrades** function.
- In the Edit Function Import dialog box, select **Entities** and choose **StudentGrade**.
- Right-click the design surface and select **Model Browser**.
- In **Model Browser**, select **Function Imports**, and then double-click the **GetStudentGrades** function.
- In the Edit Function Import dialog box, select **Entities** and choose **StudentGrade**.
*The **Function Import is composable** checkbox at the top of the **Function Imports** dialog will let you map to composable functions. If you do check this box, only composable functions (Table-valued Functions) will appear in the **Stored Procedure / Function Name** drop-down list. If you do not check this box, only non-composable functions will be shown in the list.*

## Use the Model
Expand Down Expand Up @@ -92,7 +94,6 @@ Student grade: 3.50
The department name is Engineering
```

Output Parameters
-----------------
## Output Parameters

If output parameters are used, their values will not be available until the results have been read completely. This is due to the underlying behavior of DbDataReader, see [Retrieving Data Using a DataReader](https://go.microsoft.com/fwlink/?LinkID=398589) for more details.