How to properly use IdentityUserManager in a custom module solution
ABP Framework version : v4.2.2 database provider : EF Core
I am trying to use IdentityUserManager inside a custom app service in a module solution.
what is the proper steps to include functionality from the ABP framework modules inside custom module solutions.?
I can't get your point. you should check the ABP document. https://docs.abp.io/
@realLiangshiwei When I try to use IdentityUserManager inside a custom app service in a module solution
I get this error :
Cannot resolve parameter 'Volo.Abp.Identity.IdentityUserManager userManager'
When I add nuget package Volo.Abp.Identity.Application to Application Project of the module solution,
and add [DependsOn(typeof(AbpIdentityApplicationModule))] ,
I get this error
System.NotSupportedException: Store does not implement IQueryableUserStore<TUser>.
at Microsoft.AspNetCore.Identity.UserManager`1.get_Users()
at Castle.Proxies.IdentityUserManagerProxy.get_Users_callback()
at Castle.Proxies.Invocations.UserManager`1_get_Users.InvokeMethodOnTarget()
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.DynamicProxy.AbstractInvocation.ProceedInfo.Invoke()
at Castle.DynamicProxy.AsyncInterceptorBase.ProceedSynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
I want to know the correct steps to include and use the framework modules inside my custom module solution
System.NotSupportedException: Store does not implement IQueryableUserStore
.
This interface is synchronous, and we do not recommend that you use userManager.Users etc. See https://github.com/abpframework/abp/issues/7402
@maliming I am try to add a user lookup inside my custom module solution as below.
what are the steps from adding nuget/depends on or other steps, as all other issues are only showing the code.
var query = UserManager.Users.AsQueryable()
.WhereIf(!string.IsNullOrWhiteSpace(input.Filter),
x => x.Name != null &&
x.Name.Contains(input.Filter));
You can use IIdentityUserRepository.
Works after I added below nuget / depends on in the HOST API project
<PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" Version="4.2.2" />
[DependsOn(typeof(AbpIdentityEntityFrameworkCoreModule))]