Related to this? https://github.com/aspnetzero/aspnet-zero-core/issues/1876
Try to upgrade the package. If it is still wrong, please share some relevant code.
please refer: https://github.com/aspnetzero/aspnet-zero-core/issues/1508#issuecomment-409541664
You can take look this:https://github.com/aspnetboilerplate/aspnetboilerplate/issues/3573
using Abp.EntityFrameworkCore.Repositories;
var changeTracker = yourRepository.GetDbContext().ChangeTracker;
Can you talk about it specifically? There are set reference documents here. https://docs.microsoft.com/en-us/aspnet/core/fundamentals/environments?view=aspnetcore-2.1
https://github.com/aspnetboilerplate/abp-ng2-module/blob/master/src/abpHttpInterceptor.ts#L233
All requests are intercepted, maybe you can refer to abp's interceptor to implement your own interceptor.
You can implement your own abp.message.error
https://github.com/aspnetzero/aspnet-zero-core/blob/dev/angular/src/assets/abp-web-resources/abp.sweet-alert.js#L36
First of all, I think that the verification of model parameters and the verification of other data should not be handled by EF. You should verify it before storing it in the database. The error information of the database is also difficult for users to understand.
When you detect a parameter or other business problem, just throw an exception.
Throw new UserFriendlyException("message")
Please refer to:https://aspnetboilerplate.com/Pages/Documents/Handling-Exceptions#userfriendlyexception
In fact, although you caught the exception of await unitOfWorkManager.Current.SaveChangesAsync()
.
the unit of work still calls SaveChanges
when the method call ends. causing a new exception.
You can consider using user friendly exceptions. https://aspnetboilerplate.com/Pages/Documents/Handling-Exceptions#userfriendlyexception