Please share more info. eg: error logs, screenshots
Thanks.
no see err log 1、you can click edit butoon, and then click close button ,is ok 2、can click edit button,and then click cacel button, is no response
I have opened a PR to fix this problem:
2024-01-11 17:44:13.980 +08:00 [ERR] An error occurred while saving the entity changes. See the inner exception for details. Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details. ---> Microsoft.Data.SqlClient.SqlException (0x80131904): INSERT 语句与 FOREIGN KEY 约束"FK_AppFlowingReports_AppProjectFlowings_ProjectFlowingId"冲突。该冲突发生于数据库"ProjectReward",表"dbo.AppProjectFlowings", column 'Id'。 语句已终止。
From the stack trace, it seems it can't add a record because it violates foreign key constraint, please check your entity configuration and the database.
ok,thks
hi
Please use English to describe the problem. Our suite colleagues will check the problem.
ABP Framework version: v8.0.1
UI Type: MVC
Database System: EF Core (SQL Server
Tiered (for MVC) or Auth Server Separated (for Angular): no
Exception message and full stack trace:
Steps to reproduce the issue:
1、use abp suite build entity A,Master type 2、use abp suite build entity B,Child type,set parent is A 3、run system. Create A , And then Create B,but the B save button is no response
when I search in my application the word $(this).data("projectFlowing-id") and replace the projectflowing placeholder with your entity name as lowercase. the save function can response, but has one inner exception.
2024-01-11 17:44:13.980 +08:00 [ERR] An error occurred while saving the entity changes. See the inner exception for details. Microsoft.EntityFrameworkCore.DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details. ---> Microsoft.Data.SqlClient.SqlException (0x80131904): INSERT 语句与 FOREIGN KEY 约束"FK_AppFlowingReports_AppProjectFlowings_ProjectFlowingId"冲突。该冲突发生于数据库"ProjectReward",表"dbo.AppProjectFlowings", column 'Id'。 语句已终止。
AppProjectFlowings is Parent Table。 AppFlowingReports is child Table。
多谢,问题已解决。
这是EF Core 8 的一个bug
请关注 https://github.com/dotnet/efcore/issues/32383
我会尝试找一个解决方案
好的,感谢大神,期待早日解决。
这是我的到的错误日志
[11:12:11 ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": {}, "validationErrors": null } [11:12:11 ERR] The property 'BookAuthor.BookId' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key, first delete the dependent and invoke 'SaveChanges', and then associate the dependent with the new principal. System.InvalidOperationException: The property 'BookAuthor.BookId' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key, first delete the dependent and invoke 'SaveChanges', and then associate the dependent with the new principal. at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.NavigationFixer.ConditionallyNullForeignKeyProperties(InternalEntityEntry dependentEntry, InternalEntityEntry principalEntry, IForeignKey foreignKey)
错误日志在哪里能看到,我从YourProjectWebHost目录的 logs文件夹打开的log文件,是没有这个信息的。另外,这个错误有什么处理建议吗
生成的代码,选择 ApplicationTemplate,MVC,MS SQL SERVER 数据库