Skip to content
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 @@ -339,7 +339,7 @@ The Dynamic LINQ library let you execute query with dynamic string and provide s

### EfCoreNexus.Framework

EfCoreNexus helps integrating the entity framework core into blazor apps. Via reflection it adds the entitiy classes automatically and provides you with basic crud functionality for them without writing additional code.
EfCoreNexus helps integrating the entity framework core into blazor apps. Via reflection it adds the entity classes automatically and provides you with basic crud functionality for them without writing additional code.

For EF Core: 8.

Expand Down
2 changes: 1 addition & 1 deletion entity-framework/core/modeling/owned-entities.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ To configure a different primary key call `HasKey`.

The model above is mapped to the following database schema:

![Sceenshot of the database model for entity containing owned collection](_static/owned-entities-ownsmany.png)
![Screenshot of the database model for entity containing owned collection](_static/owned-entities-ownsmany.png)

## Mapping owned types with table splitting

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Here's how to get started in a few easy steps.

### Clone this repo

Using your preferred tools, clone the repository. The `git` commmand looks like this:
Using your preferred tools, clone the repository. The `git` command looks like this:

```bash
git clone https://github.com/dotnet/EntityFramework.Docs
Expand Down
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 @@ -84,7 +84,7 @@ On the other hand, the column value is sent via a `DbParameter`, and is therefor

> [!WARNING]
>
> Be very careful when using <xref:Microsoft.EntityFrameworkCore.RelationalQueryableExtensions.FromSqlRaw%2A>, and always make sure values are either from a safe origin, or are properly sanitized. SQL injection attacks can have disasterous consequences for your application.
> Be very careful when using <xref:Microsoft.EntityFrameworkCore.RelationalQueryableExtensions.FromSqlRaw%2A>, and always make sure values are either from a safe origin, or are properly sanitized. SQL injection attacks can have disastrous consequences for your application.

## Composing with LINQ

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ context.Blogs
.ExecuteUpdate(setters => setters.SetProperty(b => b.Rating, b => b.Rating + 1));
```

Note that the second argument to `SetProperty` is now a lambda function, and not a constant as before. Its `b` parameter represents the Blog being updated; within that lambda, `b.Rating` thus contains the rating before any change occured. This executes the following SQL:
Note that the second argument to `SetProperty` is now a lambda function, and not a constant as before. Its `b` parameter represents the Blog being updated; within that lambda, `b.Rating` thus contains the rating before any change occurred. This executes the following SQL:

```sql
UPDATE [b]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ Starting with 3.0, EF Core only creates one column for `ShippingAddress`.

#### Why

The old behavoir was unexpected.
The old behavior was unexpected.

#### Mitigations

Expand Down Expand Up @@ -1421,7 +1421,7 @@ Microsoft.Data.Sqlite remains capable of reading Guid values from both BLOB and

#### Old behavior

Char values were previously sored as INTEGER values on SQLite. For example, a char value of _A_ was stored as the integer value 65.
Char values were previously stored as INTEGER values on SQLite. For example, a char value of _A_ was stored as the integer value 65.

#### New behavior

Expand Down
2 changes: 1 addition & 1 deletion entity-framework/core/what-is-new/ef-core-3.x/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Similarly to client evaluation, if EF Core 3.x can't translate a LINQ query into

## Azure Cosmos DB support

The Azure Cosmos DB provider for EF Core enables developers familiar with the EF programing model to easily target Azure Cosmos DB as an application database. The goal is to make some of the advantages of Azure Cosmos DB, like global distribution, "always on" availability, elastic scalability, and low latency, even more accessible to .NET developers. The provider enables most EF Core features, like automatic change tracking, LINQ, and value conversions, against Azure Cosmos DB for NoSQL.
The Azure Cosmos DB provider for EF Core enables developers familiar with the EF programming model to easily target Azure Cosmos DB as an application database. The goal is to make some of the advantages of Azure Cosmos DB, like global distribution, "always on" availability, elastic scalability, and low latency, even more accessible to .NET developers. The provider enables most EF Core features, like automatic change tracking, LINQ, and value conversions, against Azure Cosmos DB for NoSQL.

See the [Azure Cosmos DB provider documentation](xref:core/providers/cosmos/index) for more details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ OnDelete() | ON DELETE
NoAction | NO ACTION
ClientNoAction | NO ACTION
Restrict | RESTRICT
Cascasde | CASCADE
Cascade | CASCADE
ClientCascade | ~~RESTRICT~~ **NO ACTION**
SetNull | SET NULL
ClientSetNull | ~~RESTRICT~~ **NO ACTION**
Expand Down
2 changes: 1 addition & 1 deletion entity-framework/core/what-is-new/ef-core-6.0/whatsnew.md
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ The Azure Cosmos DB provider now translates more Base Class Library (BCL) method
| `+` operator | `CONCAT` | |
| `String.IndexOf` | `INDEX_OF` | |
| `String.Replace` | `REPLACE` | |
| `String.Equals` | `STRINGEQUAL` | Only case-insensitive calls |
| `String.Equals` | `STRINGEQUALS` | Only case-insensitive calls |

Translations for `LOWER`, `LTRIM`, `RTRIM`, `TRIM`, `UPPER`, and `SUBSTRING` were contributed by [@Marusyk](https://github.com/Marusyk). Many thanks!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ This change was made to ensure that, by default, either the connection is secure
There are three ways to proceed:

1. [Install a valid certificate on the server](/sql/database-engine/configure-windows/enable-encrypted-connections-to-the-database-engine). Note that this is an involved process and requires obtaining a certificate and ensuring it is signed by an authority trusted by the client.
2. If the server has a certificate, but it is not trusted by the client, then `TrustServerCertificate=True` to allow bypassing the normal trust mechanims.
2. If the server has a certificate, but it is not trusted by the client, then `TrustServerCertificate=True` to allow bypassing the normal trust mechanism.
3. Explicitly add `Encrypt=False` to the connection string.

> [!WARNING]
Expand Down
2 changes: 1 addition & 1 deletion entity-framework/core/what-is-new/ef-core-7.0/whatsnew.md
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,7 @@ Model:
_id PK
```

Notice that normally, `IsClean` would have been mapped, but since it is not marked with `[Perist]` (presumably because cleanliness is not a persistent property of laundry), it is now treated as an un-mapped property.
Notice that normally, `IsClean` would have been mapped, but since it is not marked with `[Persist]` (presumably because cleanliness is not a persistent property of laundry), it is now treated as an un-mapped property.

> [!TIP]
> This convention could not be implemented as a model finalizing convention because mapping a property triggers many other conventions to run to further configure the mapped property.
Expand Down
2 changes: 1 addition & 1 deletion entity-framework/core/what-is-new/ef-core-8.0/whatsnew.md
Original file line number Diff line number Diff line change
Expand Up @@ -2248,7 +2248,7 @@ You can also perform this check programmatically in your application or tests us

## Enhancements to SQLite scaffolding

SQLite only supports four primitive data types--INTEGER, REAL, TEXT, and BLOB. Previously, this meant that when you reverse engineerd a SQLite database to [scaffold an EF Core model](xref:core/managing-schemas/scaffolding), the resulting entity types would only included properties of type `long`, `double`, `string`, and `byte[]`. Additional .NET types are supported by the EF Core SQLite provider by converting between them and one of the four primitive SQLite types.
SQLite only supports four primitive data types--INTEGER, REAL, TEXT, and BLOB. Previously, this meant that when you reverse engineered a SQLite database to [scaffold an EF Core model](xref:core/managing-schemas/scaffolding), the resulting entity types would only included properties of type `long`, `double`, `string`, and `byte[]`. Additional .NET types are supported by the EF Core SQLite provider by converting between them and one of the four primitive SQLite types.

In EF Core 8, we now use the data format and column type name in addition to the SQLite type in order to determine a more appropriate .NET type to use in the model. The following tables show some of the cases where the additional information leads to better property types in the model.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Make sure the `argumentsPropagateNullability` has same number of elements as the

#### Old behavior

Previously EF returned inconsistent results for the `ToString()` method when the argument value was `null`. E.g. `ToString()` on `bool?` property with `null` value returned `null`, but for non-property `bool?` expressions whose value was `null` it returned `True`. The behavior was also incosistent for other data types, e.g. `ToString()` on `null` value enum returned empty string.
Previously EF returned inconsistent results for the `ToString()` method when the argument value was `null`. E.g. `ToString()` on `bool?` property with `null` value returned `null`, but for non-property `bool?` expressions whose value was `null` it returned `True`. The behavior was also inconsistent for other data types, e.g. `ToString()` on `null` value enum returned empty string.

#### New behavior

Expand Down
6 changes: 3 additions & 3 deletions entity-framework/core/what-is-new/ef-core-9.0/whatsnew.md
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ WHERE EXISTS (
### C# semantics for comparison operations on nullable values

In EF8 comparisons between nullable elements were not performed correctly for some scenarios. In C#, if one or both operands are null, the result of a comparison operation is false; otherwise, the contained values of operands are compared. In EF8 we used to translate comparisons using database null semantics. This would produce results different than similar query using LINQ to Objects.
Moreover, we would produce different results when comparison was done in filter vs projection. Some queris would also produce differet results between Sql Server and Sqlite/Postgres.
Moreover, we would produce different results when comparison was done in filter vs projection. Some queries would also produce different results between Sql Server and Sqlite/Postgres.

For example, the query:

Expand Down Expand Up @@ -958,7 +958,7 @@ This enhancement was contributed by the EF Team alumnus [@bricelam](https://gith

### Improved translation of logical negation operator (!)

EF9 brings many optimizimations around SQL `CASE/WHEN`, `COALESCE`, negation, and various other constructs; most of these were contributed by Andrea Canciani ([@ranma42](https://github.com/ranma42)) - many thanks for all of these! Below, we'll detail just a few of these optimizations around logical negation.
EF9 brings many optimizations around SQL `CASE/WHEN`, `COALESCE`, negation, and various other constructs; most of these were contributed by Andrea Canciani ([@ranma42](https://github.com/ranma42)) - many thanks for all of these! Below, we'll detail just a few of these optimizations around logical negation.

Let's examine the following query:

Expand Down Expand Up @@ -1570,7 +1570,7 @@ To create a node between these two children, an additional sub-level can be used
-->
[!code-csharp[HierarchyIdParse2](../../../../samples/core/Miscellaneous/NewInEFCore9/HierarchyIdSample.cs?name=HierarchyIdParse2)]

This creates a node with a `HierarchyId` of `/4/1/3/1/1.5/`, putting it bteween `child1` and `child2`.
This creates a node with a `HierarchyId` of `/4/1/3/1/1.5/`, putting it between `child1` and `child2`.

This enhancement was contributed by [@Rezakazemi890](https://github.com/Rezakazemi890). Many thanks!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ This article does not contain full details on how to implement IDbDependencyReso

**Object returned**: An EF spatial provider that adds support to the basic EF provider for geography and geometry spatial types.

**Key**: DbSptialServices is asked for in two ways. First, provider-specific spatial services are requested using a DbProviderInfo object (which contains invariant name and manifest token) as the key. Second, DbSpatialServices can be asked for with no key. This is used to resolve the "global spatial provider" which is used when creating stand-alone DbGeography or DbGeometry types.
**Key**: DbSpatialServices is asked for in two ways. First, provider-specific spatial services are requested using a DbProviderInfo object (which contains invariant name and manifest token) as the key. Second, DbSpatialServices can be asked for with no key. This is used to resolve the "global spatial provider" which is used when creating stand-alone DbGeography or DbGeometry types.

>[!NOTE]
> For more details on provider-related services in EF6 see the [EF6 provider model](xref:ef6/fundamentals/providers/provider-model) section.
Expand Down Expand Up @@ -190,7 +190,7 @@ This article does not contain full details on how to implement IDbDependencyReso

**Version introduced**: EF6.1.0

**Object returned**: A factory that will be used to create serializers for serialization of strongly-typed custom annotations such that they can be serialized and desterilized into XML for use in Code First Migrations.
**Object returned**: A factory that will be used to create serializers for serialization of strongly-typed custom annotations such that they can be serialized and deserialized into XML for use in Code First Migrations.

**Key**: The name of the annotation that is being serialized or deserialized.

Expand Down
4 changes: 2 additions & 2 deletions entity-framework/ef6/fundamentals/providers/provider-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ This is an optional service that allows a provider to create DbConnection object

### DbSpatialServices

This is an optional services that allows a provider to add support for geography and geometry spatial types. An implementation of this service must be supplied in order for an application to use EF with spatial types. DbSptialServices is asked for in two ways. First, provider-specific spatial services are requested using a DbProviderInfo object (which contains invariant name and manifest token) as key. Second, DbSpatialServices can be asked for with no key. This is used to resolve the “global spatial provider” that is used when creating stand-alone DbGeography or DbGeometry types.
This is an optional services that allows a provider to add support for geography and geometry spatial types. An implementation of this service must be supplied in order for an application to use EF with spatial types. DbSpatialServices is asked for in two ways. First, provider-specific spatial services are requested using a DbProviderInfo object (which contains invariant name and manifest token) as key. Second, DbSpatialServices can be asked for with no key. This is used to resolve the “global spatial provider” that is used when creating stand-alone DbGeography or DbGeometry types.

### MigrationSqlGenerator

Expand Down Expand Up @@ -97,7 +97,7 @@ public class MyConfiguration : DbConfiguration

## Resolving additional services

As mentioned above in the _Provider types overview_ section, a DbProviderServices class can also be used to resolve additional services. This is possible because DbProviderServices implements IDbDependencyResolver and each registered DbProviderServices type is added as a “default resolver”. The IDbDpendencyResolver mechanism is described in more detail in [Dependency Resolution](xref:ef6/fundamentals/configuring/dependency-resolution). However, it is not necessary to understand all the concepts in this specification to resolve additional services in a provider.
As mentioned above in the _Provider types overview_ section, a DbProviderServices class can also be used to resolve additional services. This is possible because DbProviderServices implements IDbDependencyResolver and each registered DbProviderServices type is added as a “default resolver”. The IDbDependencyResolver mechanism is described in more detail in [Dependency Resolution](xref:ef6/fundamentals/configuring/dependency-resolution). However, it is not necessary to understand all the concepts in this specification to resolve additional services in a provider.

The most common way for a provider to resolve additional services is to call DbProviderServices.AddDependencyResolver for each service in the constructor of the DbProviderServices class. For example, SqlProviderServices (the EF provider for SQL Server) has code similar to this for initialization:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ namespace TestingDemo

Now that we have the real EF model and the service that can use it, it's time to create the in-memory test double that we can use for testing. We've created a TestContext test double for our context. In test doubles we get to choose the behavior we want in order to support the tests we are going to run. In this example we're just capturing the number of times SaveChanges is called, but you can include whatever logic is needed to verify the scenario you are testing.

We've also created a TestDbSet that provides an in-memory implementation of DbSet. We've provided a complete implemention for all the methods on DbSet (except for Find), but you only need to implement the members that your test scenario will use.
We've also created a TestDbSet that provides an in-memory implementation of DbSet. We've provided a complete implementation for all the methods on DbSet (except for Find), but you only need to implement the members that your test scenario will use.

TestDbSet makes use of some other infrastructure classes that we've included to ensure that async queries can be processed.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ I’ll demonstrate Code First DataAnnotations with a simple pair of classes: Blo
}
```

As they are, the Blog and Post classes conveniently follow code first convention and require no tweaks to enable EF compatability. However, you can also use the annotations to provide more information to EF about the classes and the database to which they map.
As they are, the Blog and Post classes conveniently follow code first convention and require no tweaks to enable EF compatibility. However, you can also use the annotations to provide more information to EF about the classes and the database to which they map.



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ To complete this walkthrough, you will need:

![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.*
*Starting with Visual Studio 2012 the EF Designer supports bulk import of stored procedures. The **Import selected stored procedures and functions into the entity model** is checked by default.*
- 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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This Entity Framework 6 provider is a replacement provider for the built-in SQL
This provider depends on the modern [Microsoft.Data.SqlClient](https://github.com/dotnet/SqlClient) ADO.NET provider, which includes the following advantages over the currently used driver:

- Current client receiving full support in contrast to `System.Data.SqlClient`, which is in maintenance mode
- Suports new SQL Server features, including support for the SQL Server 2022 enchanced client protocol (TDS8)
- Supports new SQL Server features, including support for the SQL Server 2022 enhanced client protocol (TDS8)
- Supports most Azure Active Directory authentication methods
- Supports Always Encrypted with .NET

Expand Down
Loading
Loading