Skip to content

Commit

Permalink
EF7 Breaking changes
Browse files Browse the repository at this point in the history
Fixes #3751
Fixes #4019
Fixes #3801
Fixes #3883
Part of #3915
Fixes #4010
Fixes #4029
Fixes #4039
Fixes #4047
  • Loading branch information
ajcvickers committed Sep 20, 2022
1 parent d386dd2 commit aff9307
Show file tree
Hide file tree
Showing 6 changed files with 435 additions and 12 deletions.
2 changes: 1 addition & 1 deletion entity-framework/core/change-tracking/entity-entries.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ uid: core/change-tracking/entity-entries

There are four main APIs for accessing entities tracked by a <xref:Microsoft.EntityFrameworkCore.DbContext>:

- <xref:System.Data.Entity.DbContext.Entry%2A?displayProperty=nameWithType> returns an <xref:Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry%601> instance for a given entity instance.
- <xref:Microsoft.EntityFrameworkCore.DbContext.Entry%2A?displayProperty=nameWithType> returns an <xref:Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry%601> instance for a given entity instance.
- <xref:Microsoft.EntityFrameworkCore.ChangeTracking.ChangeTracker.Entries%2A?displayProperty=nameWithType> returns <xref:Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry%601> instances for all tracked entities, or for all tracked entities of a given type.
- <xref:Microsoft.EntityFrameworkCore.DbContext.Find%2A?displayProperty=nameWithType>, <xref:Microsoft.EntityFrameworkCore.DbContext.FindAsync%2A?displayProperty=nameWithType>, <xref:Microsoft.EntityFrameworkCore.DbSet%601.Find%2A?displayProperty=nameWithType>, and <xref:Microsoft.EntityFrameworkCore.DbSet%601.FindAsync%2A?displayProperty=nameWithType> find a single entity by primary key, first looking in tracked entities, and then querying the database if needed.
- <xref:Microsoft.EntityFrameworkCore.DbSet%601.Local?displayProperty=nameWithType> returns actual entities (not EntityEntry instances) for entities of the entity type represented by the DbSet.
Expand Down
10 changes: 9 additions & 1 deletion entity-framework/core/providers/sql-server/misc.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Miscellaneous - Microsoft SQL Server Database Provider - EF Core
description: Miscellaneous for the Microsoft SQL Server database provider
author: roji
ms.date: 06/07/2021
ms.date: 09/20/2022
uid: core/providers/sql-server/misc
---
# Miscellaneous notes for SQL Server
Expand All @@ -16,3 +16,11 @@ You can let EF Core know that the target table has a trigger; doing so will reve
[!code-csharp[Main](../../../../samples/core/SqlServer/Misc/TriggersContext.cs?name=TriggerConfiguration&highlight=4)]

Note that doing this doesn't actually make EF Core create or manage the trigger in any way - it currently only informs EF Core that triggers are present on the table. As a result, any trigger name can be used.

A model building convention can be used to configure all tables with triggers:

[!code-csharp[Main](../../../../samples/core/SqlServer/Misc/TriggersContext.cs?name=BlankTriggerAddingConvention)]

Use the convention on your `DbContext` by overriding `ConfigureConventions`:

[!code-csharp[Main](../../../../samples/core/SqlServer/Misc/TriggersContext.cs?name=ConfigureConventions)]
Loading

0 comments on commit aff9307

Please sign in to comment.