forked from dotnet/efcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve SQL Server insertion logic and other update pipeline optimiza…
…tions Also make RETURNING the default INSERT strategy for retrieving db-generated values (for other providers). Fixes dotnet#27372 Fixes dotnet#27503
- Loading branch information
Showing
43 changed files
with
2,604 additions
and
813 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/EFCore.Relational/Metadata/Builders/IConventionTriggerBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
/// <summary> | ||
/// Provides an API point for provider-specific extensions for configuring a <see cref="IConventionSequence" />. | ||
/// </summary> | ||
/// <remarks> | ||
/// See <see href="https://aka.ms/efcore-docs-conventions">Model building conventions</see> for more information and examples. | ||
/// </remarks> | ||
public interface IConventionTriggerBuilder : IConventionAnnotatableBuilder | ||
{ | ||
/// <summary> | ||
/// The trigger being configured. | ||
/// </summary> | ||
new IConventionTrigger Metadata { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
/// <summary> | ||
/// Provides an API point for provider-specific extensions for configuring a <see cref="ISequence" />. | ||
/// </summary> | ||
/// <remarks> | ||
/// See <see href="https://aka.ms/efcore-docs-triggers">Database triggers</see> for more information and examples. | ||
/// </remarks> | ||
public class TriggerBuilder | ||
{ | ||
/// <summary> | ||
/// Creates a new builder for the given <see cref="ISequence" />. | ||
/// </summary> | ||
/// <param name="trigger">The <see cref="IMutableSequence" /> to configure.</param> | ||
public TriggerBuilder(IMutableTrigger trigger) | ||
=> Metadata = trigger; | ||
|
||
/// <summary> | ||
/// The trigger. | ||
/// </summary> | ||
public virtual IMutableTrigger Metadata { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata; | ||
|
||
/// <summary> | ||
/// Represents a database sequence in the model. | ||
/// </summary> | ||
/// <remarks> | ||
/// See <see href="https://aka.ms/efcore-docs-sequences">Database sequences</see> for more information and examples. | ||
/// </remarks> | ||
public interface IConventionTrigger : IReadOnlyTrigger, IConventionAnnotatable | ||
{ | ||
/// <summary> | ||
/// Gets the <see cref="IConventionEntityType" /> on which this trigger is defined. | ||
/// </summary> | ||
new IConventionEntityType EntityType { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata; | ||
|
||
/// <summary> | ||
/// Represents a database trigger on a table. | ||
/// </summary> | ||
/// <remarks> | ||
/// <para> | ||
/// Since triggers features vary across databases, this is mainly an extension point for providers to add their own annotations. | ||
/// </para> | ||
/// <para> | ||
/// See <see href="https://aka.ms/efcore-docs-triggers">Database triggers</see> for more information and examples. | ||
/// </para> | ||
/// </remarks> | ||
public interface IMutableTrigger : IReadOnlyTrigger, IMutableAnnotatable | ||
{ | ||
/// <summary> | ||
/// Gets the <see cref="IMutableEntityType" /> on which this trigger is defined. | ||
/// </summary> | ||
new IMutableEntityType EntityType { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata; | ||
|
||
/// <summary> | ||
/// Represents a database trigger on a table. | ||
/// </summary> | ||
/// <remarks> | ||
/// <para> | ||
/// Since triggers features vary across databases, this is mainly an extension point for providers to add their own annotations. | ||
/// </para> | ||
/// <para> | ||
/// See <see href="https://aka.ms/efcore-docs-triggers">Database triggers</see> for more information and examples. | ||
/// </para> | ||
/// </remarks> | ||
public interface IReadOnlyTrigger : IReadOnlyAnnotatable | ||
{ | ||
/// <summary> | ||
/// Gets the name of the trigger in the database. | ||
/// </summary> | ||
string Name { get; } | ||
|
||
/// <summary> | ||
/// Gets the entity type on which this trigger is defined. | ||
/// </summary> | ||
IReadOnlyEntityType EntityType { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
namespace Microsoft.EntityFrameworkCore.Metadata; | ||
|
||
/// <summary> | ||
/// Represents a database trigger on a table. | ||
/// </summary> | ||
/// <remarks> | ||
/// <para> | ||
/// Since triggers features vary across databases, this is mainly an extension point for providers to add their own annotations. | ||
/// </para> | ||
/// <para> | ||
/// See <see href="https://aka.ms/efcore-docs-triggers">Database triggers</see> for more information and examples. | ||
/// </para> | ||
/// </remarks> | ||
public interface ITrigger : IReadOnlyTrigger, IAnnotatable | ||
{ | ||
/// <summary> | ||
/// Gets the entity type on which this trigger is defined. | ||
/// </summary> | ||
new IEntityType EntityType { get; } | ||
} |
Oops, something went wrong.