From 70094ddf349001d3fbfb89467d9539830644837d Mon Sep 17 00:00:00 2001 From: Oleg Zhuk Date: Fri, 6 Jun 2025 15:27:31 +0200 Subject: [PATCH] VCST-3232: Introduced ShoppingCartEntityConfiguration for SQL table configuration, disabling the SQL output clause feat: Introduced ShoppingCartEntityConfiguration for SQL table configuration, disabling the SQL output clause for resolving that SQL Server tables with triggers or certain computed columns now require special EF Core configuration https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-7.0/breaking-changes?tabs=v7#mitigations-2 --- .../Readme.md | 5 +- .../Readme.md | 5 +- .../CustomerOrderEntityConfiguration.cs | 46 +++++++++++++++++++ .../Readme.md | 5 +- 4 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 src/VirtoCommerce.OrdersModule.Data.SqlServer/CustomerOrderEntityConfiguration.cs diff --git a/src/VirtoCommerce.OrdersModule.Data.MySql/Readme.md b/src/VirtoCommerce.OrdersModule.Data.MySql/Readme.md index 437dc81f9..3781ff1db 100644 --- a/src/VirtoCommerce.OrdersModule.Data.MySql/Readme.md +++ b/src/VirtoCommerce.OrdersModule.Data.MySql/Readme.md @@ -2,13 +2,13 @@ ## Install CLI tools for Entity Framework Core ```cmd -dotnet tool install --global dotnet-ef --version 8.0.0 +dotnet tool install --global dotnet-ef --version 8.0.11 ``` or update ```cmd -dotnet tool update --global dotnet-ef --version 8.0.0 +dotnet tool update --global dotnet-ef --version 8.0.11 ``` ## Add Migration @@ -16,4 +16,3 @@ Select Data. folder and run following command for each provider: ```cmd dotnet ef migrations add -``` diff --git a/src/VirtoCommerce.OrdersModule.Data.PostgreSql/Readme.md b/src/VirtoCommerce.OrdersModule.Data.PostgreSql/Readme.md index 437dc81f9..3781ff1db 100644 --- a/src/VirtoCommerce.OrdersModule.Data.PostgreSql/Readme.md +++ b/src/VirtoCommerce.OrdersModule.Data.PostgreSql/Readme.md @@ -2,13 +2,13 @@ ## Install CLI tools for Entity Framework Core ```cmd -dotnet tool install --global dotnet-ef --version 8.0.0 +dotnet tool install --global dotnet-ef --version 8.0.11 ``` or update ```cmd -dotnet tool update --global dotnet-ef --version 8.0.0 +dotnet tool update --global dotnet-ef --version 8.0.11 ``` ## Add Migration @@ -16,4 +16,3 @@ Select Data. folder and run following command for each provider: ```cmd dotnet ef migrations add -``` diff --git a/src/VirtoCommerce.OrdersModule.Data.SqlServer/CustomerOrderEntityConfiguration.cs b/src/VirtoCommerce.OrdersModule.Data.SqlServer/CustomerOrderEntityConfiguration.cs new file mode 100644 index 000000000..b5cdc01e1 --- /dev/null +++ b/src/VirtoCommerce.OrdersModule.Data.SqlServer/CustomerOrderEntityConfiguration.cs @@ -0,0 +1,46 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using VirtoCommerce.OrdersModule.Data.Model; + +namespace VirtoCommerce.OrdersModule.Data.SqlServer; + +public class CustomerOrderEntityConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable(tb => tb.UseSqlOutputClause(false)); + } +} + +public class ShipmentEntityConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable(tb => tb.UseSqlOutputClause(false)); + } +} + +public class PaymentInEntityConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable(tb => tb.UseSqlOutputClause(false)); + } +} + +public class AddressEntityConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable(tb => tb.UseSqlOutputClause(false)); + } +} + +public class LineItemEntityConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable(tb => tb.UseSqlOutputClause(false)); + } +} + diff --git a/src/VirtoCommerce.OrdersModule.Data.SqlServer/Readme.md b/src/VirtoCommerce.OrdersModule.Data.SqlServer/Readme.md index 437dc81f9..3781ff1db 100644 --- a/src/VirtoCommerce.OrdersModule.Data.SqlServer/Readme.md +++ b/src/VirtoCommerce.OrdersModule.Data.SqlServer/Readme.md @@ -2,13 +2,13 @@ ## Install CLI tools for Entity Framework Core ```cmd -dotnet tool install --global dotnet-ef --version 8.0.0 +dotnet tool install --global dotnet-ef --version 8.0.11 ``` or update ```cmd -dotnet tool update --global dotnet-ef --version 8.0.0 +dotnet tool update --global dotnet-ef --version 8.0.11 ``` ## Add Migration @@ -16,4 +16,3 @@ Select Data. folder and run following command for each provider: ```cmd dotnet ef migrations add -```