From 80ae168bbed65714e13773bfdded0b4c3d24dd2a Mon Sep 17 00:00:00 2001 From: Ilya Belyanskiy Date: Thu, 11 Nov 2021 00:11:13 +0300 Subject: [PATCH 1/2] feat: code was updated to 6.x version --- .../Extensions/TriggerExtensions.cs | 4 ++-- .../Laraue.EfCoreTriggers.Common.csproj | 8 ++++---- .../Migrations/MigrationsModelDiffer.cs | 2 +- .../SqlGeneration/BaseExpressionProvider.cs | 2 +- .../SqlGeneration/BaseSqlProvider.cs | 2 +- .../SqlGeneration/EfCoreMetadataRetriever.cs | 4 ++-- .../Laraue.EfCoreTriggers.MySql.csproj | 2 +- src/Laraue.EfCoreTriggers.MySql/MySqlProvider.cs | 2 +- .../Laraue.EfCoreTriggers.PostgreSql.csproj | 2 +- .../PostgreSqlProvider.cs | 2 +- .../Laraue.EfCoreTriggers.SqlLite.csproj | 2 +- src/Laraue.EfCoreTriggers.SqlLite/SqlLiteProvider.cs | 2 +- .../Laraue.EfCoreTriggers.SqlServer.csproj | 2 +- .../SqlServerProvider.cs | 2 +- .../Laraue.EfCoreTriggers.MySqlTests.csproj | 10 +++++----- .../Laraue.EfCoreTriggers.PostgreSqlTests.csproj | 10 +++++----- .../Laraue.EfCoreTriggers.SqlLiteTests.csproj | 10 +++++----- .../Laraue.EfCoreTriggers.SqlServerTests.csproj | 10 +++++----- .../Laraue.EfCoreTriggers.Tests.csproj | 6 +++--- .../Tests/ConditionGeneratingTests.cs | 2 +- .../Tests/InvalidOperationTests.cs | 2 +- .../Tests/SetupProviderConverterTests.cs | 2 +- 22 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/Laraue.EfCoreTriggers.Common/Extensions/TriggerExtensions.cs b/src/Laraue.EfCoreTriggers.Common/Extensions/TriggerExtensions.cs index 6704a80..d5c7841 100644 --- a/src/Laraue.EfCoreTriggers.Common/Extensions/TriggerExtensions.cs +++ b/src/Laraue.EfCoreTriggers.Common/Extensions/TriggerExtensions.cs @@ -20,14 +20,14 @@ public static void RememberTriggerProvider(Action - netstandard2.1 + net6.0 Common classes EfCoreTriggers packages. https://github.com/win7user10/Laraue.EfCoreTriggers git @@ -15,11 +15,11 @@ - - + + all - + diff --git a/src/Laraue.EfCoreTriggers.Common/Migrations/MigrationsModelDiffer.cs b/src/Laraue.EfCoreTriggers.Common/Migrations/MigrationsModelDiffer.cs index 09b4640..3b7a264 100644 --- a/src/Laraue.EfCoreTriggers.Common/Migrations/MigrationsModelDiffer.cs +++ b/src/Laraue.EfCoreTriggers.Common/Migrations/MigrationsModelDiffer.cs @@ -129,7 +129,7 @@ public static IList AddCreateTriggerSqlMigration(this IList AddDeleteTriggerSqlMigration(this IList list, IAnnotation annotation, IModel model) + public static IList AddDeleteTriggerSqlMigration(this IList list, IAnnotation annotation, IReadOnlyModel model) { list.Add(new SqlOperation { diff --git a/src/Laraue.EfCoreTriggers.Common/SqlGeneration/BaseExpressionProvider.cs b/src/Laraue.EfCoreTriggers.Common/SqlGeneration/BaseExpressionProvider.cs index 1d9fedf..0b8db07 100644 --- a/src/Laraue.EfCoreTriggers.Common/SqlGeneration/BaseExpressionProvider.cs +++ b/src/Laraue.EfCoreTriggers.Common/SqlGeneration/BaseExpressionProvider.cs @@ -357,7 +357,7 @@ protected virtual SqlBuilder GetConstantExpressionSql(ConstantExpression constan public AvailableConverters Converters { get; } = new (); /// - protected BaseExpressionProvider(IModel model) : base(model) + protected BaseExpressionProvider(IReadOnlyModel model) : base(model) { } diff --git a/src/Laraue.EfCoreTriggers.Common/SqlGeneration/BaseSqlProvider.cs b/src/Laraue.EfCoreTriggers.Common/SqlGeneration/BaseSqlProvider.cs index 8c71e5c..f4790c6 100644 --- a/src/Laraue.EfCoreTriggers.Common/SqlGeneration/BaseSqlProvider.cs +++ b/src/Laraue.EfCoreTriggers.Common/SqlGeneration/BaseSqlProvider.cs @@ -11,7 +11,7 @@ namespace Laraue.EfCoreTriggers.Common.SqlGeneration { public abstract class BaseSqlProvider : BaseExpressionProvider, ITriggerProvider { - protected BaseSqlProvider(IModel model) : base(model) + protected BaseSqlProvider(IReadOnlyModel model) : base(model) { } diff --git a/src/Laraue.EfCoreTriggers.Common/SqlGeneration/EfCoreMetadataRetriever.cs b/src/Laraue.EfCoreTriggers.Common/SqlGeneration/EfCoreMetadataRetriever.cs index d22f1b7..ec83822 100644 --- a/src/Laraue.EfCoreTriggers.Common/SqlGeneration/EfCoreMetadataRetriever.cs +++ b/src/Laraue.EfCoreTriggers.Common/SqlGeneration/EfCoreMetadataRetriever.cs @@ -30,13 +30,13 @@ public class EfCoreMetadataRetriever /// /// Model used for generating SQL. From this model takes column names, table names and other meta information. /// - protected IModel Model { get; } + protected IReadOnlyModel Model { get; } /// /// Initializes new instance of . /// /// - protected EfCoreMetadataRetriever(IModel model) + protected EfCoreMetadataRetriever(IReadOnlyModel model) { Model = model ?? throw new ArgumentNullException(nameof(model)); } diff --git a/src/Laraue.EfCoreTriggers.MySql/Laraue.EfCoreTriggers.MySql.csproj b/src/Laraue.EfCoreTriggers.MySql/Laraue.EfCoreTriggers.MySql.csproj index 4cde6b1..17272d5 100644 --- a/src/Laraue.EfCoreTriggers.MySql/Laraue.EfCoreTriggers.MySql.csproj +++ b/src/Laraue.EfCoreTriggers.MySql/Laraue.EfCoreTriggers.MySql.csproj @@ -1,7 +1,7 @@  - netstandard2.1 + net6.0 Generating native MySql triggers through migrations using EFCore entity builder. https://github.com/win7user10/Laraue.EfCoreTriggers git diff --git a/src/Laraue.EfCoreTriggers.MySql/MySqlProvider.cs b/src/Laraue.EfCoreTriggers.MySql/MySqlProvider.cs index 4c6e48c..751ffbd 100644 --- a/src/Laraue.EfCoreTriggers.MySql/MySqlProvider.cs +++ b/src/Laraue.EfCoreTriggers.MySql/MySqlProvider.cs @@ -28,7 +28,7 @@ namespace Laraue.EfCoreTriggers.MySql { public class MySqlProvider : BaseSqlProvider { - public MySqlProvider(IModel model) : base(model) + public MySqlProvider(IReadOnlyModel model) : base(model) { AddConverter(new ConcatStringViaConcatFuncConverter()); AddConverter(new StringToUpperViaUpperFuncConverter()); diff --git a/src/Laraue.EfCoreTriggers.PostgreSql/Laraue.EfCoreTriggers.PostgreSql.csproj b/src/Laraue.EfCoreTriggers.PostgreSql/Laraue.EfCoreTriggers.PostgreSql.csproj index e33492c..da7a2a1 100644 --- a/src/Laraue.EfCoreTriggers.PostgreSql/Laraue.EfCoreTriggers.PostgreSql.csproj +++ b/src/Laraue.EfCoreTriggers.PostgreSql/Laraue.EfCoreTriggers.PostgreSql.csproj @@ -1,7 +1,7 @@  - netstandard2.1 + net6.0 Generating native PostgreSql triggers through migrations using EFCore entity builder. https://github.com/win7user10/Laraue.EfCoreTriggers git diff --git a/src/Laraue.EfCoreTriggers.PostgreSql/PostgreSqlProvider.cs b/src/Laraue.EfCoreTriggers.PostgreSql/PostgreSqlProvider.cs index 915d6f8..3910f49 100644 --- a/src/Laraue.EfCoreTriggers.PostgreSql/PostgreSqlProvider.cs +++ b/src/Laraue.EfCoreTriggers.PostgreSql/PostgreSqlProvider.cs @@ -25,7 +25,7 @@ namespace Laraue.EfCoreTriggers.PostgreSql { public class PostgreSqlProvider : BaseSqlProvider { - public PostgreSqlProvider(IModel model) : base(model) + public PostgreSqlProvider(IReadOnlyModel model) : base(model) { AddConverter(new ConcatStringViaConcatFuncConverter()); AddConverter(new StringToUpperViaUpperFuncConverter()); diff --git a/src/Laraue.EfCoreTriggers.SqlLite/Laraue.EfCoreTriggers.SqlLite.csproj b/src/Laraue.EfCoreTriggers.SqlLite/Laraue.EfCoreTriggers.SqlLite.csproj index ed5a33c..8756eca 100644 --- a/src/Laraue.EfCoreTriggers.SqlLite/Laraue.EfCoreTriggers.SqlLite.csproj +++ b/src/Laraue.EfCoreTriggers.SqlLite/Laraue.EfCoreTriggers.SqlLite.csproj @@ -1,7 +1,7 @@  - netstandard2.1 + net6.0 Generating native SqlLite triggers through migrations using EFCore entity builder. https://github.com/win7user10/Laraue.EfCoreTriggers git diff --git a/src/Laraue.EfCoreTriggers.SqlLite/SqlLiteProvider.cs b/src/Laraue.EfCoreTriggers.SqlLite/SqlLiteProvider.cs index cd3639f..fda1024 100644 --- a/src/Laraue.EfCoreTriggers.SqlLite/SqlLiteProvider.cs +++ b/src/Laraue.EfCoreTriggers.SqlLite/SqlLiteProvider.cs @@ -27,7 +27,7 @@ namespace Laraue.EfCoreTriggers.SqlLite { public class SqlLiteProvider : BaseSqlProvider { - public SqlLiteProvider(IModel model) : base(model) + public SqlLiteProvider(IReadOnlyModel model) : base(model) { AddConverter(new ConcatStringViaDoubleVerticalLineConverter()); AddConverter(new StringToUpperViaUpperFuncConverter()); diff --git a/src/Laraue.EfCoreTriggers.SqlServer/Laraue.EfCoreTriggers.SqlServer.csproj b/src/Laraue.EfCoreTriggers.SqlServer/Laraue.EfCoreTriggers.SqlServer.csproj index d39be64..ce97384 100644 --- a/src/Laraue.EfCoreTriggers.SqlServer/Laraue.EfCoreTriggers.SqlServer.csproj +++ b/src/Laraue.EfCoreTriggers.SqlServer/Laraue.EfCoreTriggers.SqlServer.csproj @@ -1,7 +1,7 @@  - netstandard2.1 + net6.0 Generating native SqlServer triggers through migrations using EFCore entity builder. https://github.com/win7user10/Laraue.EfCoreTriggers git diff --git a/src/Laraue.EfCoreTriggers.SqlServer/SqlServerProvider.cs b/src/Laraue.EfCoreTriggers.SqlServer/SqlServerProvider.cs index 473506f..743e7bc 100644 --- a/src/Laraue.EfCoreTriggers.SqlServer/SqlServerProvider.cs +++ b/src/Laraue.EfCoreTriggers.SqlServer/SqlServerProvider.cs @@ -28,7 +28,7 @@ namespace Laraue.EfCoreTriggers.SqlServer { public class SqlServerProvider : BaseSqlProvider { - public SqlServerProvider(IModel model) : base(model) + public SqlServerProvider(IReadOnlyModel model) : base(model) { AddConverter(new ConcatStringViaPlusConverter()); AddConverter(new StringToUpperViaUpperFuncConverter()); diff --git a/tests/Laraue.EfCoreTriggers.MySqlTests/Laraue.EfCoreTriggers.MySqlTests.csproj b/tests/Laraue.EfCoreTriggers.MySqlTests/Laraue.EfCoreTriggers.MySqlTests.csproj index 8130fc7..fd3933e 100644 --- a/tests/Laraue.EfCoreTriggers.MySqlTests/Laraue.EfCoreTriggers.MySqlTests.csproj +++ b/tests/Laraue.EfCoreTriggers.MySqlTests/Laraue.EfCoreTriggers.MySqlTests.csproj @@ -1,14 +1,14 @@ - net5.0 + net6.0 false - - + + runtime; build; native; contentfiles; analyzers; buildtransitive @@ -18,10 +18,10 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all - + all - + all diff --git a/tests/Laraue.EfCoreTriggers.PostgreSqlTests/Laraue.EfCoreTriggers.PostgreSqlTests.csproj b/tests/Laraue.EfCoreTriggers.PostgreSqlTests/Laraue.EfCoreTriggers.PostgreSqlTests.csproj index ca7b30c..4ed8758 100644 --- a/tests/Laraue.EfCoreTriggers.PostgreSqlTests/Laraue.EfCoreTriggers.PostgreSqlTests.csproj +++ b/tests/Laraue.EfCoreTriggers.PostgreSqlTests/Laraue.EfCoreTriggers.PostgreSqlTests.csproj @@ -1,13 +1,13 @@ - net5.0 + net6.0 false - - + + all @@ -17,10 +17,10 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all - + all diff --git a/tests/Laraue.EfCoreTriggers.SqlLiteTests/Laraue.EfCoreTriggers.SqlLiteTests.csproj b/tests/Laraue.EfCoreTriggers.SqlLiteTests/Laraue.EfCoreTriggers.SqlLiteTests.csproj index 9b6ca54..a7c8139 100644 --- a/tests/Laraue.EfCoreTriggers.SqlLiteTests/Laraue.EfCoreTriggers.SqlLiteTests.csproj +++ b/tests/Laraue.EfCoreTriggers.SqlLiteTests/Laraue.EfCoreTriggers.SqlLiteTests.csproj @@ -1,14 +1,14 @@  - net5.0 + net6.0 false - - + + all @@ -18,10 +18,10 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all - + all diff --git a/tests/Laraue.EfCoreTriggers.SqlServerTests/Laraue.EfCoreTriggers.SqlServerTests.csproj b/tests/Laraue.EfCoreTriggers.SqlServerTests/Laraue.EfCoreTriggers.SqlServerTests.csproj index d6f7a93..50cd612 100644 --- a/tests/Laraue.EfCoreTriggers.SqlServerTests/Laraue.EfCoreTriggers.SqlServerTests.csproj +++ b/tests/Laraue.EfCoreTriggers.SqlServerTests/Laraue.EfCoreTriggers.SqlServerTests.csproj @@ -1,14 +1,14 @@ - net5.0 + net6.0 false - - + + all @@ -18,10 +18,10 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all - + all diff --git a/tests/Laraue.EfCoreTriggers.Tests/Laraue.EfCoreTriggers.Tests.csproj b/tests/Laraue.EfCoreTriggers.Tests/Laraue.EfCoreTriggers.Tests.csproj index 0103557..fbc9ee7 100644 --- a/tests/Laraue.EfCoreTriggers.Tests/Laraue.EfCoreTriggers.Tests.csproj +++ b/tests/Laraue.EfCoreTriggers.Tests/Laraue.EfCoreTriggers.Tests.csproj @@ -1,15 +1,15 @@  - net5.0 + net6.0 false - + - + diff --git a/tests/Laraue.EfCoreTriggers.Tests/Tests/ConditionGeneratingTests.cs b/tests/Laraue.EfCoreTriggers.Tests/Tests/ConditionGeneratingTests.cs index ca52186..abda526 100644 --- a/tests/Laraue.EfCoreTriggers.Tests/Tests/ConditionGeneratingTests.cs +++ b/tests/Laraue.EfCoreTriggers.Tests/Tests/ConditionGeneratingTests.cs @@ -14,7 +14,7 @@ namespace Laraue.EfCoreTriggers.Tests.Tests public class ConditionGeneratingTests { private readonly ITriggerProvider _provider; - private readonly IModel _model; + private readonly IMutableModel _model; public ConditionGeneratingTests() { diff --git a/tests/Laraue.EfCoreTriggers.Tests/Tests/InvalidOperationTests.cs b/tests/Laraue.EfCoreTriggers.Tests/Tests/InvalidOperationTests.cs index ec43920..54dc07c 100644 --- a/tests/Laraue.EfCoreTriggers.Tests/Tests/InvalidOperationTests.cs +++ b/tests/Laraue.EfCoreTriggers.Tests/Tests/InvalidOperationTests.cs @@ -19,7 +19,7 @@ public class InvalidOperationTests public InvalidOperationTests() { var modelBuilder = new ModelBuilder(); - IModel model = modelBuilder.Model; + IReadOnlyModel model = modelBuilder.Model; _provider = new MySqlProvider(model); } diff --git a/tests/Laraue.EfCoreTriggers.Tests/Tests/SetupProviderConverterTests.cs b/tests/Laraue.EfCoreTriggers.Tests/Tests/SetupProviderConverterTests.cs index 47e8c2d..5e7c1a1 100644 --- a/tests/Laraue.EfCoreTriggers.Tests/Tests/SetupProviderConverterTests.cs +++ b/tests/Laraue.EfCoreTriggers.Tests/Tests/SetupProviderConverterTests.cs @@ -24,7 +24,7 @@ public SetupProviderConverterTests() modelBuilder.Entity() .Property("Description"); - IModel model = modelBuilder.Model; + IReadOnlyModel model = modelBuilder.Model; _provider = new MySqlProvider(model); } From 5d3703bfe4cf96e836ecc78dfc4d60f806524646 Mon Sep 17 00:00:00 2001 From: Ilya Belyanskiy Date: Thu, 11 Nov 2021 18:21:35 +0300 Subject: [PATCH 2/2] feat: package version changed fix: tests upd: readme --- readme.md | 2 +- .../Laraue.EfCoreTriggers.Common.csproj | 3 +-- .../Laraue.EfCoreTriggers.MySql.csproj | 3 +-- .../Laraue.EfCoreTriggers.PostgreSql.csproj | 3 +-- .../Laraue.EfCoreTriggers.SqlLite.csproj | 3 +-- .../Laraue.EfCoreTriggers.SqlServer.csproj | 3 +-- .../Laraue.EfCoreTriggers.Tests.csproj | 2 +- 7 files changed, 7 insertions(+), 12 deletions(-) diff --git a/readme.md b/readme.md index e56c059..6e4ab04 100644 --- a/readme.md +++ b/readme.md @@ -5,7 +5,7 @@ EfCoreTriggers is the library to write native SQL triggers using EFCore model bu [![latest version](https://img.shields.io/nuget/v/Laraue.EfCoreTriggers.Common)](https://www.nuget.org/packages/Laraue.EfCoreTriggers.Common) ### Installation -EfCoreTriggers common package is available on [NuGet](https://www.nuget.org/packages/Laraue.EfCoreTriggers.Common). Install the provider package corresponding to your target database. See the list of providers in the docs for additional databases. +EfCoreTriggers common package is available on Nuget. Version 6.x.x is compatible with .NET6, 1.x.x intended for .NET 5 and no more supported. Install the provider package corresponding to your target database. See the list of providers in the docs for additional databases. ### Configuring DB to use triggers diff --git a/src/Laraue.EfCoreTriggers.Common/Laraue.EfCoreTriggers.Common.csproj b/src/Laraue.EfCoreTriggers.Common/Laraue.EfCoreTriggers.Common.csproj index a76d959..c84b9e3 100644 --- a/src/Laraue.EfCoreTriggers.Common/Laraue.EfCoreTriggers.Common.csproj +++ b/src/Laraue.EfCoreTriggers.Common/Laraue.EfCoreTriggers.Common.csproj @@ -7,11 +7,10 @@ git Belyanskiy Ilya false - 1.0.1 https://github.com/win7user10/Laraue.EfCoreTriggers Entity Framework Core;entity-framework-core;ef;efcore;triggers;sql Latest - 1.1.1 + 6.0.0 diff --git a/src/Laraue.EfCoreTriggers.MySql/Laraue.EfCoreTriggers.MySql.csproj b/src/Laraue.EfCoreTriggers.MySql/Laraue.EfCoreTriggers.MySql.csproj index 17272d5..a65fe63 100644 --- a/src/Laraue.EfCoreTriggers.MySql/Laraue.EfCoreTriggers.MySql.csproj +++ b/src/Laraue.EfCoreTriggers.MySql/Laraue.EfCoreTriggers.MySql.csproj @@ -7,11 +7,10 @@ git Belyanskiy Ilya false - 1.0.1 https://github.com/win7user10/Laraue.EfCoreTriggers Entity Framework Core;entity-framework-core;ef;efcore;triggers;sql;MySql Latest - 1.1.1 + 6.0.0 diff --git a/src/Laraue.EfCoreTriggers.PostgreSql/Laraue.EfCoreTriggers.PostgreSql.csproj b/src/Laraue.EfCoreTriggers.PostgreSql/Laraue.EfCoreTriggers.PostgreSql.csproj index da7a2a1..8f51e7e 100644 --- a/src/Laraue.EfCoreTriggers.PostgreSql/Laraue.EfCoreTriggers.PostgreSql.csproj +++ b/src/Laraue.EfCoreTriggers.PostgreSql/Laraue.EfCoreTriggers.PostgreSql.csproj @@ -7,11 +7,10 @@ git Belyanskiy Ilya false - 1.0.1 https://github.com/win7user10/Laraue.EfCoreTriggers Entity Framework Core;entity-framework-core;ef;efcore;triggers;sql;PostgreSql Latest - 1.1.1 + 6.0.0 diff --git a/src/Laraue.EfCoreTriggers.SqlLite/Laraue.EfCoreTriggers.SqlLite.csproj b/src/Laraue.EfCoreTriggers.SqlLite/Laraue.EfCoreTriggers.SqlLite.csproj index 8756eca..8226dc4 100644 --- a/src/Laraue.EfCoreTriggers.SqlLite/Laraue.EfCoreTriggers.SqlLite.csproj +++ b/src/Laraue.EfCoreTriggers.SqlLite/Laraue.EfCoreTriggers.SqlLite.csproj @@ -7,11 +7,10 @@ git Belyanskiy Ilya false - 1.0.1 https://github.com/win7user10/Laraue.EfCoreTriggers Entity Framework Core;entity-framework-core;ef;efcore;triggers;sql;SqlLite Latest - 1.1.1 + 6.0.0 diff --git a/src/Laraue.EfCoreTriggers.SqlServer/Laraue.EfCoreTriggers.SqlServer.csproj b/src/Laraue.EfCoreTriggers.SqlServer/Laraue.EfCoreTriggers.SqlServer.csproj index ce97384..6751d0c 100644 --- a/src/Laraue.EfCoreTriggers.SqlServer/Laraue.EfCoreTriggers.SqlServer.csproj +++ b/src/Laraue.EfCoreTriggers.SqlServer/Laraue.EfCoreTriggers.SqlServer.csproj @@ -7,11 +7,10 @@ git Belyanskiy Ilya false - 1.0.1 https://github.com/win7user10/Laraue.EfCoreTriggers Entity Framework Core;entity-framework-core;ef;efcore;triggers;sql;SqlServer Latest - 1.1.1 + 6.0.0 diff --git a/tests/Laraue.EfCoreTriggers.Tests/Laraue.EfCoreTriggers.Tests.csproj b/tests/Laraue.EfCoreTriggers.Tests/Laraue.EfCoreTriggers.Tests.csproj index fbc9ee7..dce920f 100644 --- a/tests/Laraue.EfCoreTriggers.Tests/Laraue.EfCoreTriggers.Tests.csproj +++ b/tests/Laraue.EfCoreTriggers.Tests/Laraue.EfCoreTriggers.Tests.csproj @@ -6,7 +6,7 @@ - +