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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Breaking changes in EF Core 8.0 (EF8) - EF Core
description: Complete list of breaking changes introduced in Entity Framework Core 8.0 (EF8)
author: ajcvickers
ms.date: 12/18/2023
ms.date: 10/04/2024
uid: core/what-is-new/ef-core-8.0/breaking-changes
---

Expand Down Expand Up @@ -34,6 +34,8 @@ EF Core 8 targets .NET 8. Applications targeting older .NET, .NET Core, and .NET
| [Scaffolding may generate different navigation names](#navigation-names) | Low |
| [Discriminators now have a max length](#discriminators) | Low |
| [SQL Server key values are compared case-insensitively](#casekeys) | Low |
| [Multiple AddDbContext calls are applied in different order](#AddDbContext) | Low |
| [EntityTypeAttributeConventionBase replaced with TypeAttributeConventionBase](#attributeConventionBase) | Low |

## High-impact changes

Expand Down Expand Up @@ -533,3 +535,41 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
});
}
```

<a name="AddDbContext"></a>

### Multiple AddDbContext calls are applied in different order

[Tracking Issue #32518](https://github.com/dotnet/efcore/issues/32518)

#### Old behavior

Previously, when multiple calls to `AddDbContext`, `AddDbContextPool`, `AddDbContextFactory` or `AddPooledDbContextFactor` were made with the same context type but conflicting configuration, the first one won.

#### New behavior

Starting with EF Core 8.0, the configuration from the last call one will take precedence.

#### Why

This was changed to be consistent with the new method `ConfigureDbContext` that can be used to add configuration either before or after the `Add*` methods.

#### Mitigations

Reverse the order of `Add*` calls.

<a name="attributeConventionBase"></a>

### EntityTypeAttributeConventionBase replaced with TypeAttributeConventionBase

#### New behavior

In EF Core 8.0 `EntityTypeAttributeConventionBase` was renamed to `TypeAttributeConventionBase`.

#### Why

`TypeAttributeConventionBase` represents the functionality better as it now can be used for complex types and entity types.

#### Mitigations

Replace `EntityTypeAttributeConventionBase` usages with `TypeAttributeConventionBase`.
8 changes: 4 additions & 4 deletions entity-framework/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
items:
- name: Welcome!
href: core/index.md
- name: "What's new in EF Core 8.0"
href: core/what-is-new/ef-core-8.0/whatsnew.md
- name: "Breaking changes in EF Core 8.0"
href: core/what-is-new/ef-core-8.0/breaking-changes.md
- name: "What's new in EF Core 9.0"
href: core/what-is-new/ef-core-9.0/whatsnew.md
- name: "Breaking changes in EF Core 9.0"
href: core/what-is-new/ef-core-9.0/breaking-changes.md
- name: Getting started
items:
- name: EF Core Overview
Expand Down
Loading