Activities of "Spospisil"

I need a resolution to this asap.

Yes, it's an MVC Tiered solution, however your suggestion did not resolve the issue. Can you please explain how the payment application service can be called directly from the web projects code?

What I find a little odd is in you Volo.Payment.Application source you have 3 App Services defined for the Payment Module as shown below. However in the Volo.Payment.HttpAPI source there is a Gateway and Plan controller that essentially call the application services as shown above but you don't have a 'PaymentRequestController' in the HttpAPI project as shown below.

Why is that?

  • ABP Framework version: v4.4.4
  • UI type: MVC
  • DB provider: EF Core
  • **Tiered (MVC)

I am trying to create a subscription payment in my web (mvc) project from a test page and have references set ABPPaymentWebModule and AbpPaymentStripeWebModule but when I execute the 'CreateAsync' method on the PaymentRequestAppService I get the below error.

Can you tell me what the problem is?

public class IndexModel : PageModel
{
    private readonly IPaymentRequestAppService _paymentRequestAppService;
    protected ICurrentTenant CurrentTenant { get; }

    public IndexModel(IPaymentRequestAppService paymentrequestservice,
        ICurrentTenant currentTenant
        )
    {
        CurrentTenant = currentTenant;
        _paymentRequestAppService = paymentrequestservice;
    }

    public async Task<IActionResult> OnPostAsync()
    {
        var organizationId = Guid.NewGuid().ToString();

        var paymentRequestDto = new PaymentRequestCreateDto
        {
            ExtraProperties =
            {
                { "OrganizationId", organizationId },
                {
                    StripeConsts.GatewayName,
                    new StripePaymentRequestExtraParameterConfiguration
                    {
                        Currency = "USD",
                        Locale = "it",
                        PaymentMethodTypes = new List<string>()
                        {
                            "alipay",
                            "sofort"
                        },
                        AdditionalCallbackParameters = "s=1"
                    }
                }
            }
        };

        paymentRequestDto.Products.Add(new PaymentRequestProductCreateDto
        {
            Code = "001",
            Count = 1,
            Name = "Personal License",
            UnitPrice = 999,
            TotalPrice = 1 * 999
        });

        var paymentRequest = await _paymentRequestAppService.CreateAsync(paymentRequestDto);

        return LocalRedirectPreserveMethod("/Payment/GatewaySelection?paymentRequestId=" + paymentRequest.Id);

    }
    

2021-12-17 16:13:05.848 -05:00 [ERR] An unhandled exception has occurred while executing the request. Volo.Abp.AbpException: Could not found remote action for method: System.Threading.Tasks.Task1[Volo.Payment.Requests.PaymentRequestWithDetailsDto] CreateAsync(Volo.Payment.Requests.PaymentRequestCreateDto) on the URL: https://localhost:44300/ at Volo.Abp.Http.Client.DynamicProxying.ApiDescriptionFinder.FindActionAsync(HttpClient client, String baseUrl, Type serviceType, MethodInfo method) in C:\Src\StructureWeb\ABP\framework\src\Volo.Abp.Http.Client\Volo\Abp\Http\Client\DynamicProxying\ApiDescriptionFinder.cs:line 81 at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.MakeRequestAsync(IAbpMethodInvocation invocation) in C:\Src\StructureWeb\ABP\framework\src\Volo.Abp.Http.Client\Volo\Abp\Http\Client\DynamicProxying\DynamicHttpProxyInterceptor.cs:line 145 at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.MakeRequestAndGetResultAsync[T](IAbpMethodInvocation invocation) in C:\Src\StructureWeb\ABP\framework\src\Volo.Abp.Http.Client\Volo\Abp\Http\Client\DynamicProxying\DynamicHttpProxyInterceptor.cs:line 108 at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.GetResultAsync(Task task, Type resultType) in C:\Src\StructureWeb\ABP\framework\src\Volo.Abp.Http.Client\Volo\Abp\Http\Client\DynamicProxying\DynamicHttpProxyInterceptor.cs:line 99 at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.InterceptAsync(IAbpMethodInvocation invocation) in C:\Src\StructureWeb\ABP\framework\src\Volo.Abp.Http.Client\Volo\Abp\Http\Client\DynamicProxying\DynamicHttpProxyInterceptor.cs:line 90 at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) in C:\Src\StructureWeb\ABP\framework\src\Volo.Abp.Castle.Core\Volo\Abp\Castle\DynamicProxy\CastleAsyncAbpInterceptorAdapter.cs:line 29 at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() in C:\Src\StructureWeb\ABP\framework\src\Volo.Abp.Castle.Core\Volo\Abp\Castle\DynamicProxy\CastleAbpMethodInvocationAdapterWithReturnValue.cs:line 24 at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) in C:\Src\StructureWeb\ABP\framework\src\Volo.Abp.Validation\Volo\Abp\Validation\ValidationInterceptor.cs:line 19 at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) in C:\Src\StructureWeb\ABP\framework\src\Volo.Abp.Castle.Core\Volo\Abp\Castle\DynamicProxy\CastleAsyncAbpInterceptorAdapter.cs:line 29 at CFData.StructureWeb.Web.Pages.Jobs.IndexModel.OnPostAsync() in C:\Src\StructureWeb\aspnet-core\src\StructureWeb.Web\Pages\Jobs\Index.cshtml.cs:line 62 at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync() at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync() at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeNextResourceFilter() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\Src\StructureWeb\ABP\framework\src\Volo.Abp.AspNetCore.Serilog\Volo\Abp\AspNetCore\Serilog\AbpSerilogMiddleware.cs:line 65 at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\Src\StructureWeb\ABP\framework\src\Volo.Abp.AspNetCore\Volo\Abp\AspNetCore\Auditing\AbpAuditingMiddleware.cs:line 52 at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\Src\StructureWeb\ABP\framework\src\Volo.Abp.AspNetCore\Volo\Abp\AspNetCore\Auditing\AbpAuditingMiddleware.cs:line 81 at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Volo.Abp.AspNetCore.MultiTenancy.MultiTenancyMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\Src\StructureWeb\ABP\framework\src\Volo.Abp.AspNetCore.MultiTenancy\Volo\Abp\AspNetCore\MultiTenancy\MultiTenancyMiddleware.cs:line 75 at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) in C:\Src\StructureWeb\ABP\framework\src\Volo.Abp.AspNetCore\Microsoft\AspNetCore\RequestLocalization\AbpRequestLocalizationMiddleware.cs:line 51 at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context) 2021-12-17 16:13:05.898 -05:00 [INF] Request finished HTTP/2 POST https://localhost:44302/Jobs application/x-www-form-urlencoded 225 - 500 - text/html;+charset=utf-8 11508.6571ms

  • ABP Framework version: v4.4.4
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): Tiered

For the 'Payment' module there is no entry in the en.json file for "Permission:Payment" resulting in the text 'Permission:Payment' on the permissions popup page for the payment permissions section. Similarly there is no entry for "Permission:PaymentGatewayPlanManagement.Default" in the en.json file as the PaymentAdminPermissionDeffinitionProvider is expecting. The entry in the en.json file for this setting is just ""Permission:PaymentGatewayPlanManagement"

when I remove the 'DependsOn' attribute of 'LanguageManagement......Module' though I no longer get the error, however I will need to keep this in my module.

Nope. This didn't work either. Same issue. Now the error says the below after additng theDbTablePrefix of 'CF'

Exception thrown: 'Npgsql.PostgresException' in Microsoft.EntityFrameworkCore.Relational.dll An exception of type 'Npgsql.PostgresException' occurred in Microsoft.EntityFrameworkCore.Relational.dll but was not handled in user code 42P01: relation "CFLanguageTexts" does not exist

Please reference my original screenshot in terms of the table names.

Here is the related log messages.

2021-11-17 08:34:38.671 -05:00 [INF] Request starting HTTP/1.1 GET https://localhost:44300/api/abp/multi-tenancy/tenants/by-id/3a00402b-022a-c209-bd72-28f9859e70b4?api-version=1.0 - - 2021-11-17 08:34:38.946 -05:00 [INF] Successfully validated the token. 2021-11-17 08:34:38.961 -05:00 [INF] Executing endpoint 'Pages.Abp.MultiTenancy.AbpTenantController.FindTenantByIdAsync (Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy)' 2021-11-17 08:34:38.963 -05:00 [INF] Route matched with {area = "abp", action = "FindTenantById", controller = "AbpTenant", page = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Volo.Abp.AspNetCore.Mvc.MultiTenancy.FindTenantResultDto] FindTenantByIdAsync(System.Guid) on controller Pages.Abp.MultiTenancy.AbpTenantController (Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy). 2021-11-17 08:34:38.979 -05:00 [INF] Executing action method Pages.Abp.MultiTenancy.AbpTenantController.FindTenantByIdAsync (Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy) - Validation state: "Valid" 2021-11-17 08:34:38.991 -05:00 [INF] Executed action method Pages.Abp.MultiTenancy.AbpTenantController.FindTenantByIdAsync (Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy), returned result Microsoft.AspNetCore.Mvc.ObjectResult in 12.2466ms. 2021-11-17 08:34:38.993 -05:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.AspNetCore.Mvc.MultiTenancy.FindTenantResultDto'. 2021-11-17 08:34:38.995 -05:00 [INF] Executed action Pages.Abp.MultiTenancy.AbpTenantController.FindTenantByIdAsync (Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy) in 31.9413ms 2021-11-17 08:34:38.995 -05:00 [INF] Executed endpoint 'Pages.Abp.MultiTenancy.AbpTenantController.FindTenantByIdAsync (Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy)' 2021-11-17 08:34:38.995 -05:00 [INF] Request finished HTTP/1.1 GET https://localhost:44300/api/abp/multi-tenancy/tenants/by-id/3a00402b-022a-c209-bd72-28f9859e70b4?api-version=1.0 - - - 200 - application/json;+charset=utf-8 324.9255ms 2021-11-17 08:34:39.030 -05:00 [INF] Request starting HTTP/1.1 GET https://localhost:44300/api/abp/application-configuration?api-version=1.0 - - 2021-11-17 08:34:39.031 -05:00 [INF] Successfully validated the token. 2021-11-17 08:34:39.035 -05:00 [INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)' 2021-11-17 08:34:39.035 -05:00 [INF] Route matched with {area = "abp", action = "Get", controller = "AbpApplicationConfiguration", page = ""}. Executing controller action with signature System.Threading.Tasks.Task1[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto] GetAsync() on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController (Volo.Abp.AspNetCore.Mvc). 2021-11-17 08:34:39.036 -05:00 [INF] Executing action method Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc) - Validation state: "Valid" 2021-11-17 08:34:39.057 -05:00 [INF] Entity Framework Core 5.0.12 initialized 'FeatureManagementDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: QuerySplittingBehavior=SplitQuery 2021-11-17 08:34:39.069 -05:00 [INF] Executed DbCommand (3ms) [Parameters=[@__providerName_0='?', @__providerKey_1='?'], CommandType='"Text"', CommandTimeout='30'] SELECT f."Id", f."Name", f."ProviderKey", f."ProviderName", f."Value" FROM "FeatureValues" AS f WHERE (f."ProviderName" = @__providerName_0) AND (f."ProviderKey" = @__providerKey_1) 2021-11-17 08:34:39.348 -05:00 [INF] Entity Framework Core 5.0.12 initialized 'LanguageManagementDbContext' using provider 'Npgsql.EntityFrameworkCore.PostgreSQL' with options: QuerySplittingBehavior=SplitQuery 2021-11-17 08:34:39.427 -05:00 [ERR] Failed executing DbCommand (12ms) [Parameters=[@__ef_filter__p_0='?' (DbType = Boolean), @__ef_filter__CurrentTenantId_1='?' (DbType = Guid), @__resourceName_0='?', @__cultureName_1='?'], CommandType='"Text"', CommandTimeout='30'] SELECT l."Id", l."CreationTime", l."CreatorId", l."CultureName", l."LastModificationTime", l."LastModifierId", l."Name", l."ResourceName", l."TenantId", l."Value" FROM "LanguageTexts" AS l WHERE (@__ef_filter__p_0 OR (l."TenantId" = @__ef_filter__CurrentTenantId_1)) AND ((l."ResourceName" = @__resourceName_0) AND (l."CultureName" = @__cultureName_1)) 2021-11-17 08:34:39.458 -05:00 [ERR] An exception occurred while iterating over the results of a query for context type 'Volo.Abp.LanguageManagement.EntityFrameworkCore.LanguageManagementDbContext'. Npgsql.PostgresException (0x80004005): 42P01: relation "LanguageTexts" does not exist at Npgsql.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|194_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) at Npgsql.NpgsqlDataReader.NextResult() at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior) at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader() at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject) at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable1.Enumerator.InitializeReader(DbContext _, Boolean result) at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.Execute[TState,TResult](TState state, Func3 operation, Func3 verifySucceeded) at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable1.Enumerator.MoveNext() Exception data: Severity: ERROR SqlState: 42P01 MessageText: relation "LanguageTexts" does not exist Position: 170 File: d:\pginstaller_13.auto\postgres.windows-x64\src\backend\parser\parse_relation.c Line: 1376 Routine: parserOpenTable Npgsql.PostgresException (0x80004005): 42P01: relation "LanguageTexts" does not exist at Npgsql.NpgsqlConnector.<ReadMessage>g__ReadMessageLong|194_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) at Npgsql.NpgsqlDataReader.NextResult() at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior) at Npgsql.NpgsqlCommand.ExecuteDbDataReader(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader() at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject) at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable1.Enumerator.InitializeReader(DbContext _, Boolean result) at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.Execute[TState,TResult](TState state, Func3 operation, Func3 verifySucceeded) at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable1.Enumerator.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) at Volo.Abp.LanguageManagement.EntityFrameworkCore.EfCoreLanguageTextRepository.GetList(String resourceName, String cultureName) in C:\Src\StructureWeb\ABP-Pro-Modules\language-management\src\Volo.Abp.LanguageManagement.EntityFrameworkCore\Volo\Abp\LanguageManagement\EntityFrameworkCore\EfCoreLanguageTextRepository.cs:line 27 at Castle.Proxies.Invocations.ILanguageTextRepository_GetList.InvokeMethodOnTarget() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.DynamicProxy.AbstractInvocation.ProceedInfo.Invoke() at Castle.DynamicProxy.AsyncInterceptorBase.ProceedSynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) Exception data: Severity: ERROR SqlState: 42P01 MessageText: relation "LanguageTexts" does not exist Position: 170 File: d:\pginstaller_13.auto\postgres.windows-x64\src\backend\parser\parse_relation.c Line: 1376 Routine: parserOpenTable

[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IConnectionStringResolver))]
public class SWMultiTenantConnectionStringResolver : MultiTenantConnectionStringResolver
{
    private readonly ICurrentTenant _currentTenant;
    private readonly IServiceProvider _serviceProvider;

    public SWMultiTenantConnectionStringResolver(
        IOptionsSnapshot&lt;AbpDbConnectionOptions&gt; options,
        ICurrentTenant currentTenant,
        IServiceProvider serviceProvider) : base(options, currentTenant, serviceProvider)
    {
        _currentTenant = currentTenant;
        _serviceProvider = serviceProvider;
    }

    public override async Task&lt;string&gt; ResolveAsync(string connectionStringName = null)
    {
        string connectionstring = "";

        //No current tenant, fallback to default logic
        if (_currentTenant.Id == null)
        {
            return await base.ResolveAsync(connectionStringName);
        }


        if (_currentTenant.IsAvailable)
        {
            switch (connectionStringName)
            {
                case LanguageManagementDbProperties.ConnectionStringName:
                case AbpPermissionManagementDbProperties.ConnectionStringName:
                case FeatureManagementDbProperties.ConnectionStringName:
                    using (_currentTenant.Change(null))
                    {
                        connectionstring = await base.ResolveAsync(connectionStringName);
                    }
                    break;

                case "Volo.Abp.Identity.EntityFrameworkCore.IIdentityProDbContext":
                    using (_currentTenant.Change(null))
                    {
                        connectionstring = await base.ResolveAsync(connectionStringName);
                    }
                    break;

                case "Default":
                    using (_currentTenant.Change(null))
                    {
                        connectionstring = await base.ResolveAsync(connectionStringName);
                    }
                    break;

                default:
                    var tenant = await FindTenantConfigurationAsync(_currentTenant.Id.Value);

                    if (tenant == null || tenant.ConnectionStrings.IsNullOrEmpty())
                    {
                        //Tenant has not defined any connection string, fallback to default logic
                        return await base.ResolveAsync(connectionStringName);
                    }

                    connectionstring = tenant.ConnectionStrings.Default;
                    break;
            }
        }

        //Replace with the following code when 5.0 is released
        //if (connectionStringName == AbpIdentityDbProperties.ConnectionStringName)
        //{
        //    //.. return host's connection string
        //}
        return await Task.FromResult(connectionstring);
    }
}

What specifically in the code do you need to see?

Showing 311 to 320 of 375 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 12, 2025, 10:20