With the help of Identity Dapper, I want to get a list of all users, but when accessing the Users property from the UserManager class, an exception is thrown.
Based on the commentary, I realized that the dupper does not support IQueryable. I also found out that all the logic for working with the database is located in the UserRepository class, which implements the IUserRepository
Question: how to expand the UserManager class, and add a method to get a list of all users from the database? I also need to inject the extended class in the ConfigureServices method in the Startup class.
//piece of code from Identity.Dapper.Stores
public class DapperUserStore<TUser, TKey, TUserRole, TRoleClaim, TUserClaim, TUserLogin, TRole> :
IUserStore<TUser>,
IUserLoginStore<TUser>,
IUserRoleStore<TUser>,
IUserClaimStore<TUser>,
IUserPasswordStore<TUser>,
IUserSecurityStampStore<TUser>,
IUserEmailStore<TUser>,
IUserLockoutStore<TUser>,
IUserPhoneNumberStore<TUser>,
IQueryableUserStore<TUser>,
IUserTwoFactorStore<TUser>,
IUserAuthenticationTokenStore<TUser>
where TUser : DapperIdentityUser<TKey, TUserClaim, TUserRole, TUserLogin>
where TKey : IEquatable<TKey>
where TUserRole : DapperIdentityUserRole<TKey>
where TRoleClaim : DapperIdentityRoleClaim<TKey>
where TUserClaim : DapperIdentityUserClaim<TKey>
where TUserLogin : DapperIdentityUserLogin<TKey>
where TRole : DapperIdentityRole<TKey, TUserRole, TRoleClaim>
{
...
public IQueryable<TUser> Users
{
get
{
//Impossible to implement IQueryable with Dapper
throw new NotImplementedException();
}
}
...
}