Hi @liangshiwei,
I have sent you the source code, please help us take a look.
Thank you
Hi, I am using the module project template, I have created a separate database for the new tenant:
Below is the connection strings from HttpApi.Host:
"ConnectionStrings": {
"Default": "Server=localhost;Database=PartnersBuddy_Main;Trusted_Connection=True;MultipleActiveResultSets=true",
"PartnersBuddy": "Server=localhost;Database=PartnersBuddy_Module;Trusted_Connection=True;MultipleActiveResultSets=true"
},
I have created a new tenant with the below connection string:
"Server=localhost;Database=PartnersBuddy_Module_TenantA;Trusted_Connection=True;MultipleActiveResultSets=true"
When I tried to login to the new tenant, I got the below error, I guess it was trying to query the Identity Server Client from the new tenant connection string, but I only created new database for the module only, and there is no place for me to put the connection string for the "Main" when creating the new tenant:
[16:47:02 ERR] An exception occurred while iterating over the results of a query for context type 'Volo.Abp.IdentityServer.EntityFrameworkCore.IdentityServerDbContext'.
Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name 'IdentityServerClientCorsOrigins'.
at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__164_0(Task`1 result)
at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
ClientConnectionId:b2bab897-dbe1-4985-bc79-3e208f9d407d
Any help would be greatly appreciated!
Ok, I got it.
Thanks @maliming
Hi, I have a scenario that user from another tenancy want to have their own login page with different look & feel. Currently, when calling the identity server authorize endpoint, it redirects to the ABP default login page, is there a way I can pass an extra parameter and configure to the the other custom login page?
Hi @maliming,
It works perfectly. Thanks a lot for your support
Hi @maliming, I have followed the code but it does not work, I have sent the code via email, could you please help us take a look?
Thank you.
Hi @maliming, the PR updated the AbpAutoMapperModule.cs, may I know how can I override this module file?
so far, I know how to override the application service/controller only: https://docs.abp.io/en/abp/4.4/Customizing-Application-Modules-Overriding-Services
Thank you.
Hi @maliming, thank you for your prompt reply.
We dont have plan to upgrade the version yet, is there any workaround or any other solution to inject a service in AutoMapper?
If you're creating a bug/problem report, please include followings:
Hi, I am trying to figure out how to inject a service in AutoMapper profile, I have tried the IMappingAction method from the link below: https://docs.automapper.org/en/stable/Before-and-after-map-actions.html
but got this exception:
[21:31:09 ERR] Error mapping types.
Mapping types:
Object -> List`1
System.Object -> System.Collections.Generic.List`1[[TestA, TestProject.Application.Contracts, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null]]
AutoMapper.AutoMapperMappingException: Error mapping types.
Mapping types:
Object -> List`1
System.Object -> System.Collections.Generic.List`1[[TestA, TestProject.Application.Contracts, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null]]
---> System.MissingMethodException: No parameterless constructor defined for type 'TestProject.TestMappingAction'.
at System.RuntimeType.CreateInstanceDefaultCtorSlow(Boolean publicOnly, Boolean wrapExceptions, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, Boolean wrapExceptions)
at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions)
at System.Activator.CreateInstance(Type type)
at AutoMapper.Configuration.MappingExpressionBase`3.<AfterMap>g__AfterFunction|11_0[TMappingAction](TSource src, TDestination dest, ResolutionContext ctxt)
at lambda_method(Closure , Object , List`1 , ResolutionContext )
--- End of inner exception stack trace ---
at lambda_method(Closure , Object , List`1 , ResolutionContext )
at Volo.Abp.AutoMapper.AutoMapperAutoObjectMappingProvider.Map[TSource,TDestination](Object source)
at Volo.Abp.ObjectMapping.DefaultObjectMapper.AutoMap[TSource,TDestination](Object source)
at Volo.Abp.ObjectMapping.DefaultObjectMapper.Map[TSource,TDestination](TSource source)
What did I miss in my configuration? Any help would be greatly appreciated.
Hi @maliming, the issue has been resolved :)
Thanks a lot for your support.