Base solution for your next web application

Activities of "Simonlum"

Prerequisites

Please answer the following questions before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • What is your product version? V8.7
  • What is your product type (Angular or MVC)? ANGULAR
  • What is product framework type (.net framework or .net core)? .NET CORE

Hi Team My project was running well a few days ago,but today an error came up

![image.png](/QA/files/9b24c68c2d05d8aa5d3239fc0a7f8d59.png)

Thank you @mnetolicky , i found the Dapper is also mapping the Table to Entity one by one ,my question is my stored procedure will return two or more tables (and the table might be include extra column calculated by other columns) ,so i want to recevie a dataset in ASPNETZERO and then convert to the models what i expected, i have no idea how can i handle this case;

Hi, I have a stored procedure and return a dataset, so how can i receive the dataset in AspNetZero Project,Could you please give me some examples; thanks;

Hi team,

I want to use store procedure in my project. and i followed the tutorial step by step: https://aspnetboilerplate.com/Pages/Documents/Articles/Using-Stored-Procedures,-User-Defined-Functions-and-Views/index.html.

when i run my project and i get the error:

InvalidOperationException: The connection does not support MultipleActiveResultSets. STACK TRACE: at Microsoft.Data.SqlClient.SqlInternalConnectionTds.ValidateConnectionForExecute(SqlCommand command) at Microsoft.Data.SqlClient.SqlInternalTransaction.Rollback() at Microsoft.Data.SqlClient.SqlTransaction.Dispose(Boolean disposing) at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction.Dispose() at Abp.EntityFrameworkCore.Uow.DbContextEfCoreTransactionStrategy.Dispose(IIocResolver iocResolver) at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.DisposeUow() at Abp.Domain.Uow.UnitOfWorkBase.Dispose() at Abp.AspNetCore.Mvc.Uow.AbpUowActionFilter.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

So i tried to set MultipleActiveResultSets=true in the connection string and i get another error:

SqlException: The transaction operation cannot be performed because there are pending requests working on this transaction. STACK TRACE: at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at Microsoft.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at Microsoft.Data.SqlClient.TdsParser.TdsExecuteTransactionManagerRequest(Byte[] buffer, TransactionManagerRequestType request, String transactionName, TransactionManagerIsolationLevel isoLevel, Int32 timeout, SqlInternalTransaction transaction, TdsParserStateObject stateObj, Boolean isDelegateControlRequest) at Microsoft.Data.SqlClient.SqlInternalConnectionTds.ExecuteTransactionYukon(TransactionRequest transactionRequest, String transactionName, IsolationLevel iso, SqlInternalTransaction internalTransaction, Boolean isDelegateControlRequest) at Microsoft.Data.SqlClient.SqlInternalTransaction.Commit() at Microsoft.Data.SqlClient.SqlTransaction.Commit() at Microsoft.EntityFrameworkCore.Storage.RelationalTransaction.Commit() at Abp.EntityFrameworkCore.Uow.DbContextEfCoreTransactionStrategy.Commit() at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.CommitTransaction() at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.CompleteUowAsync() at Abp.Domain.Uow.UnitOfWorkBase.CompleteAsync() at Abp.AspNetCore.Mvc.Uow.AbpUowActionFilter.OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted

below is my code:

public class DashboardRepository : DynasysSolutionRepositoryBase<Company, long>, IDashboardRepository { private readonly IActiveTransactionProvider _transactionProvider; public DashboardRepository(IDbContextProvider<DynasysSolutionDbContext> dbContextProvider, IActiveTransactionProvider transactionProvider) : base(dbContextProvider) { _transactionProvider = transactionProvider; }

    public async Task&lt;List&lt;GetSupplierStatusOutput&gt;> GetSupplierStatus(int tenantId)
    {

        EnsureConnectionOpen();
        using (var command = CreateCommand("Exec SP_GetSupplierStatisticByStatus @tenantId", CommandType.StoredProcedure, new SqlParameter("@tenantId", tenantId)))
        {
            using (var dataReader = await command.ExecuteReaderAsync())
            {
                List&lt;GetSupplierStatusOutput&gt; list = new List&lt;GetSupplierStatusOutput&gt;();

                while (dataReader.Read())
                {
                    list.Add(new GetSupplierStatusOutput()
                    {
                        Name = dataReader["Status"].ToString(),
                        Count = Convert.ToInt32(dataReader["NumsOfSupplier"])
                    });
                }
                return list;
            }
        }

    }

    private DbCommand CreateCommand(string commandText, CommandType commandType, params SqlParameter[] parameters)
    {
        var command = GetConnection().CreateCommand();

        command.CommandText = commandText;
        command.CommandType = commandType;
        command.Transaction = GetActiveTransaction();
        foreach (var parameter in parameters)
        {
            command.Parameters.Add(parameter);
        }

        return command;
    }

    private void EnsureConnectionOpen()
    {
        var connection = GetConnection();

        if (connection.State != ConnectionState.Open)
        {
            connection.Open();
        }
    }

    private DbTransaction GetActiveTransaction()
    {
        return (DbTransaction)_transactionProvider.GetActiveTransaction(new ActiveTransactionProviderArgs
        {
            {"ContextType", typeof(DynasysSolutionDbContext) },
            {"MultiTenancySide", MultiTenancySide }
        });
    }

Hi @ismcagdas thanks for your response but it seems to the OpenIdConnect does not implement。

Can you give a detailed configuration tutorial

Hi team I built two website, one is Asp.net Core 8.7 ,the other is Asp.net Core10.1 i want to share user login authen for each other,can it be done thank you

Dear team, If there are some relationships under the master entity,when user delete the entity i want to pop friendly message instead of the 500. I used try catch in delete method, but the method cannot catch the exception i want to catch ,it still pop the 500. could you give me some advices thanks. my code as below; public async Task Delete(EntityDto<long> input) { try { await _companyRepository.DeleteAsync(input.Id); } catch(Exception ex) { throw new UserFriendlyException(L("CannotDeleteSupplier")); } }

angular asp.net core 8.7 Hi Team

I want to use security image question (captcha) on login.
![image.png](/QA/files/02d6e22c0146fe90b96939fb083ddae7.png)

But when I turn it on,There's an error as below,I can't access Google
ngx-captcha.js:742 GET https://www.google.com/recaptcha/api.js?onload=ngx_captcha_onload_callback&render=explicit net::ERR_CONNECTION_TIMED_OUT

HI Team,

When i run the command npm start in VSCode console, the nodejs use a lot of CPU & Memory, How can i sovle this issue?

Many thanks.

Angular aspnetcore V8.7

Dear ** An error occurred during publication**

28 error 403 403 Forbidden - PUT http://registry.npmjs.org/abp-zero-template - You do not have permission to publish "abp-zero-template". Are you logged in as the correct user? 29 error 403 In most cases, you or one of your dependencies are requesting 29 error 403 a package version that is forbidden by your security policy.

Showing 1 to 10 of 22 entries