Tag Archives: abp

When the ABP framework clock uses dapper, httppost calls the interface to report an error. Solution

1. The query method is tested separately successfully, and the httpget interface is called successfully. However, if it is called by the httpput or httppost interface, an error [err] beginexecutereader requires the command to have a transaction when the connection assigned to the command is in a pending local transaction   The Transaction property of the command has not been initialized.

Temporary processing method: using (idbconnection = dbconnection){

…connection.QueryAsync<T>…

}

Change to

DbConnection.QueryAsync< T>

 

 

2. If the above method is still unsuccessful, add the [unitofwork (false, isolationlevel. Readcommitted)] attribute to the httppost interface of the controller layer.

 

The ABP framework (aspnet boilerplate) sets the front-end error display

ABP throws an exception at the back end

throw new UserFriendlyException($"report an error");

Before publishing, you need to set whether to send an error to the front end
if this is set to true, all exceptions and details will be sent directly to the client in case of an error. Default value: false (ABP hides the exception details from the client, except for special exceptions.)

public override void PreInitialize()
{
    Configuration.Modules.AbpWebCommon().SendAllExceptionsToClients = false;
    #if DEBUG
    Configuration.Modules.AbpWebCommon().SendAllExceptionsToClients = true;
    #endif
}