Search code examples
c#asp.net-coreasp.net-identity

ASP.net core IQueryableUserStore how to implement


Can someone explain to me how I can implement IQueryableUserStore in my UserStore?

This is my UserStore:

 public class UserStore : IUserStore<ApplicationUser>, IUserEmailStore<ApplicationUser>, IUserPhoneNumberStore<ApplicationUser>,
    IUserTwoFactorStore<ApplicationUser>, IUserPasswordStore<ApplicationUser>, IUserRoleStore<ApplicationUser>, IUserCustom<ApplicationUser>, IQueryableUserStore<ApplicationUser>
{ 
     ...
     public IQueryable<ApplicationUser> Users => throw new NotImplementedException();
     ...
}

My goal is to have the ability to have a method to retrieve my ApplicationUser custom field; if I try to use this command

 (_userManager.Users.FirstOrDefault().MyCustomField)` 

I've got an error about

IQueryableUserStore not implemented.


Solution

  • public IQueryable<ApplicationUser> Users { get; set; }