You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: entity-framework/core/get-started/index.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ cd EFGetStarted
50
50
51
51
## Install Entity Framework Core
52
52
53
-
To install EF Core, you install the package for the EF Core database provider(s) you want to target. This tutorial uses SQLite because it runs on all platforms that .NET Core supports. For a list of available providers, see [Database Providers](../providers/index.md).
53
+
To install EF Core, you install the package for the EF Core database provider(s) you want to target. This tutorial uses SQLite because it runs on all platforms that .NET Core supports. For a list of available providers, see [Database Providers](xref:core/providers/index).
54
54
55
55
### [.NET Core CLI](#tab/netcore-cli)
56
56
@@ -89,9 +89,9 @@ Define a context class and entity classes that make up the model.
EF Core can also [reverse engineer](../managing-schemas/scaffolding.md) a model from an existing database.
92
+
EF Core can also [reverse engineer](xref:core/managing-schemas/scaffolding) a model from an existing database.
93
93
94
-
Tip: This application intentionally keeps things simple for clarity. [Connection strings](../miscellaneous/connection-strings.md) should not be stored in the code for production applications. You may also want to split each C# class into its own file.
94
+
Tip: This application intentionally keeps things simple for clarity. [Connection strings](xref:core/miscellaneous/connection-strings) should not be stored in the code for production applications. You may also want to split each C# class into its own file.
95
95
96
96
## Create the database
97
97
@@ -108,7 +108,7 @@ The following steps use [migrations](xref:core/managing-schemas/migrations/index
108
108
dotnet ef database update
109
109
```
110
110
111
-
This installs [dotnet ef](../miscellaneous/cli/dotnet.md) and the design package which is required to run the command on a project. The `migrations` command scaffolds a migration to create the initial set of tables for the model. The `database update` command creates the database and applies the new migration to it.
111
+
This installs [dotnet ef](xref:core/miscellaneous/cli/dotnet) and the design package which is required to run the command on a project. The `migrations` command scaffolds a migration to create the initial set of tables for the model. The `database update` command creates the database and applies the new migration to it.
112
112
113
113
### [Visual Studio](#tab/visual-studio)
114
114
@@ -120,7 +120,7 @@ The following steps use [migrations](xref:core/managing-schemas/migrations/index
120
120
Update-Database
121
121
```
122
122
123
-
This installs the [PMC tools for EF Core](../miscellaneous/cli/powershell.md). The `Add-Migration` command scaffolds a migration to create the initial set of tables for the model. The `Update-Database` command creates the database and applies the new migration to it.
123
+
This installs the [PMC tools for EF Core](xref:core/miscellaneous/cli/powershell). The `Add-Migration` command scaffolds a migration to create the initial set of tables for the model. The `Update-Database` command creates the database and applies the new migration to it.
Copy file name to clipboardExpand all lines: entity-framework/core/index.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -13,28 +13,28 @@ Entity Framework (EF) Core is a lightweight, extensible, [open source](https://g
13
13
14
14
EF Core can serve as an object-relational mapper (O/RM), enabling .NET developers to work with a database using .NET objects, and eliminating the need for most of the data-access code they usually need to write.
15
15
16
-
EF Core supports many database engines, see [Database Providers](providers/index.md) for details.
16
+
EF Core supports many database engines, see [Database Providers](xref:core/providers/index) for details.
17
17
18
18
## The Model
19
19
20
-
With EF Core, data access is performed using a model. A model is made up of entity classes and a context object that represents a session with the database, allowing you to query and save data. See [Creating a Model](modeling/index.md) to learn more.
20
+
With EF Core, data access is performed using a model. A model is made up of entity classes and a context object that represents a session with the database, allowing you to query and save data. See [Creating a Model](xref:core/modeling/index) to learn more.
21
21
22
-
You can generate a model from an existing database, hand code a model to match your database, or use [EF Migrations](managing-schemas/migrations/index.md) to create a database from your model, and then evolve it as your model changes over time.
22
+
You can generate a model from an existing database, hand code a model to match your database, or use [EF Migrations](xref:core/managing-schemas/migrations/index) to create a database from your model, and then evolve it as your model changes over time.
Instances of your entity classes are retrieved from the database using Language Integrated Query (LINQ). See [Querying Data](querying/index.md) to learn more.
28
+
Instances of your entity classes are retrieved from the database using Language Integrated Query (LINQ). See [Querying Data](xref:core/querying/index) to learn more.
Data is created, deleted, and modified in the database using instances of your entity classes. See [Saving Data](saving/index.md) to learn more.
34
+
Data is created, deleted, and modified in the database using instances of your entity classes. See [Saving Data](xref:core/saving/index) to learn more.
The EnsureCreated and EnsureDeleted methods provide a lightweight alternative to [Migrations](migrations/index.md) for managing the database schema. These methods are useful in scenarios when the data is transient and can be dropped when the schema changes. For example during prototyping, in tests, or for local caches.
11
+
The EnsureCreated and EnsureDeleted methods provide a lightweight alternative to [Migrations](xref:core/managing-schemas/migrations/index) for managing the database schema. These methods are useful in scenarios when the data is transient and can be dropped when the schema changes. For example during prototyping, in tests, or for local caches.
12
12
13
13
Some providers (especially non-relational ones) don't support Migrations. For these providers, EnsureCreated is often the easiest way to initialize the database schema.
Copy file name to clipboardExpand all lines: entity-framework/core/managing-schemas/scaffolding.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -150,9 +150,9 @@ Finally, the model is used to generate code. The corresponding entity type class
150
150
151
151
## Limitations
152
152
153
-
* Not everything about a model can be represented using a database schema. For example, information about [**inheritance hierarchies**](../modeling/inheritance.md), [**owned types**](../modeling/owned-entities.md), and [**table splitting**](../modeling/table-splitting.md) are not present in the database schema. Because of this, these constructs will never be reverse engineered.
153
+
* Not everything about a model can be represented using a database schema. For example, information about [**inheritance hierarchies**](xref:core/modeling/inheritance), [**owned types**](xref:core/modeling/owned-entities), and [**table splitting**](xref:core/modeling/table-splitting) are not present in the database schema. Because of this, these constructs will never be reverse engineered.
154
154
* In addition, **some column types** may not be supported by the EF Core provider. These columns won't be included in the model.
155
-
* You can define [**concurrency tokens**](../modeling/concurrency.md), in an EF Core model to prevent two users from updating the same entity at the same time. Some databases have a special type to represent this type of column (for example, rowversion in SQL Server) in which case we can reverse engineer this information; however, other concurrency tokens will not be reverse engineered.
155
+
* You can define [**concurrency tokens**](xref:core/modeling/concurrency), in an EF Core model to prevent two users from updating the same entity at the same time. Some databases have a special type to represent this type of column (for example, rowversion in SQL Server) in which case we can reverse engineer this information; however, other concurrency tokens will not be reverse engineered.
156
156
*[The C# 8 nullable reference type feature](/dotnet/csharp/tutorials/nullable-reference-types) is currently unsupported in reverse engineering: EF Core always generates C# code that assumes the feature is disabled. For example, nullable text columns will be scaffolded as a property with type `string` , not `string?`, with either the Fluent API or Data Annotations used to configure whether a property is required or not. You can edit the scaffolded code and replace these with C# nullability annotations. Scaffolding support for nullable reference types is tracked by issue [#15520](https://github.com/aspnet/EntityFrameworkCore/issues/15520).
Copy file name to clipboardExpand all lines: entity-framework/core/miscellaneous/1x-2x-upgrade.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -125,7 +125,7 @@ Note that this change only applies to APIs/metadata that is defined for _all_ re
125
125
126
126
## Don’t take control of the EF service provider
127
127
128
-
EF Core uses an internal `IServiceProvider` (a dependency injection container) for its internal implementation. Applications should allow EF Core to create and manage this provider except in special cases. Strongly consider removing any calls to `UseInternalServiceProvider`. If an application does need to call `UseInternalServiceProvider`, then please consider [filing an issue](https://github.com/aspnet/EntityFramework/Issues) so we can investigate other ways to handle your scenario.
128
+
EF Core uses an internal `IServiceProvider` (a dependency injection container) for its internal implementation. Applications should allow EF Core to create and manage this provider except in special cases. Strongly consider removing any calls to `UseInternalServiceProvider`. If an application does need to call `UseInternalServiceProvider`, then please consider [filing an issue](https://github.com/dotnet/efcore/Issues) so we can investigate other ways to handle your scenario.
129
129
130
130
Calling `AddEntityFramework`, `AddEntityFrameworkSqlServer`, etc. is not required by application code unless `UseInternalServiceProvider` is also called. Remove any existing calls to `AddEntityFramework` or `AddEntityFrameworkSqlServer`, etc. `AddDbContext` should still be used in the same way as before.
The command-line interface (CLI) tools for Entity Framework Core perform design-time development tasks. For example, they create [migrations](/aspnet/core/data/ef-mvc/migrations?view=aspnetcore-2.0), apply migrations, and generate code for a model based on an existing database. The commands are an extension to the cross-platform [dotnet](/dotnet/core/tools) command, which is part of the [.NET Core SDK](https://www.microsoft.com/net/core). These tools work with .NET Core projects.
13
13
14
-
If you're using Visual Studio, we recommend the [Package Manager Console tools](powershell.md) instead:
14
+
If you're using Visual Studio, we recommend the [Package Manager Console tools](xref:core/miscellaneous/cli/powershell) instead:
15
15
16
16
* They automatically work with the current project selected in the **Package Manager Console** without requiring that you manually switch directories.
17
17
* They automatically open files generated by a command after the command is completed.
The Entity Framework Core tools help with design-time development tasks. They're primarily used to manage Migrations and to scaffold a
13
13
`DbContext` and entity types by reverse engineering the schema of a database.
14
14
15
-
* The [EF Core Package Manager Console tools](powershell.md) run in
15
+
* The [EF Core Package Manager Console tools](xref:core/miscellaneous/cli/powershell) run in
16
16
the [Package Manager Console](/nuget/tools/package-manager-console) in Visual Studio.
17
17
18
-
* The [EF Core .NET command-line interface (CLI) tools](dotnet.md) are an extension to the cross-platform [.NET Core CLI tools](/dotnet/core/tools/). These tools require a .NET Core SDK project (one with `Sdk="Microsoft.NET.Sdk"` or similar in the project file).
18
+
* The [EF Core .NET command-line interface (CLI) tools](xref:core/miscellaneous/cli/dotnet) are an extension to the cross-platform [.NET Core CLI tools](/dotnet/core/tools/). These tools require a .NET Core SDK project (one with `Sdk="Microsoft.NET.Sdk"` or similar in the project file).
19
19
20
20
Both tools expose the same functionality. If you're developing in Visual Studio, we recommend using the **Package Manager Console** tools since
The Package Manager Console (PMC) tools for Entity Framework Core perform design-time development tasks. For example, they create [migrations](/aspnet/core/data/ef-mvc/migrations?view=aspnetcore-2.0), apply migrations, and generate code for a model based on an existing database. The commands run inside of Visual Studio using the [Package Manager Console](/nuget/tools/package-manager-console). These tools work with both .NET Framework and .NET Core projects.
12
12
13
-
If you aren't using Visual Studio, we recommend the [EF Core Command-line Tools](dotnet.md) instead. The .NET Core CLI tools are cross-platform and run inside a command prompt.
13
+
If you aren't using Visual Studio, we recommend the [EF Core Command-line Tools](xref:core/miscellaneous/cli/dotnet) instead. The .NET Core CLI tools are cross-platform and run inside a command prompt.
Copy file name to clipboardExpand all lines: entity-framework/core/miscellaneous/rc1-rc2-upgrade.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ If you have RC1 code that passes an `IServiceProvider` to the context, this has
80
80
81
81
### Testing
82
82
83
-
The most common scenario for doing this was to control the scope of an InMemory database when testing. See the updated [Testing](testing/index.md) article for an example of doing this with RC2.
83
+
The most common scenario for doing this was to control the scope of an InMemory database when testing. See the updated [Testing](xref:core/miscellaneous/testing/index) article for an example of doing this with RC2.
84
84
85
85
### Resolving Internal Services from Application Service Provider (ASP.NET Core Projects Only)
Note that backing fields are only discovered for properties that are included in the model. For more information on which properties are included in the model, see [Including & Excluding Properties](included-properties.md).
26
+
Note that backing fields are only discovered for properties that are included in the model. For more information on which properties are included in the model, see [Including & Excluding Properties](xref:core/modeling/entity-properties).
27
27
28
28
You can also configure backing fields by using a Data Annotation (available in EFCore 5.0) or the Fluent API, e.g. if the field name doesn't correspond to the above conventions:
29
29
@@ -48,7 +48,7 @@ See the [PropertyAccessMode enum](/dotnet/api/microsoft.entityframeworkcore.prop
48
48
49
49
## Field-only properties
50
50
51
-
You can also create a conceptual property in your model that does not have a corresponding CLR property in the entity class, but instead uses a field to store the data in the entity. This is different from [Shadow Properties](shadow-properties.md), where the data is stored in the change tracker, rather than in the entity's CLR type. Field-only properties are commonly used when the entity class uses methods instead of properties to get/set values, or in cases where fields shouldn't be exposed at all in the domain model (e.g. primary keys).
51
+
You can also create a conceptual property in your model that does not have a corresponding CLR property in the entity class, but instead uses a field to store the data in the entity. This is different from [Shadow Properties](xref:core/modeling/shadow-properties), where the data is stored in the change tracker, rather than in the entity's CLR type. Field-only properties are commonly used when the entity class uses methods instead of properties to get/set values, or in cases where fields shouldn't be exposed at all in the domain model (e.g. primary keys).
52
52
53
53
You can configure a field-only property by providing a name in the `Property(...)` API:
Copy file name to clipboardExpand all lines: entity-framework/core/modeling/concurrency.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ uid: core/modeling/concurrency
9
9
# Concurrency Tokens
10
10
11
11
> [!NOTE]
12
-
> This page documents how to configure concurrency tokens. See [Handling Concurrency Conflicts](../saving/concurrency.md) for a detailed explanation of how concurrency control works on EF Core and examples of how to handle concurrency conflicts in your application.
12
+
> This page documents how to configure concurrency tokens. See [Handling Concurrency Conflicts](xref:core/saving/concurrency) for a detailed explanation of how concurrency control works on EF Core and examples of how to handle concurrency conflicts in your application.
13
13
14
14
Properties configured as concurrency tokens are used to implement optimistic concurrency control.
0 commit comments