I want to get all users for specific role. I have write below query. But it gives me converstion error.

List<Expression<Func<AspNetUsers, object>>> include = new List<Expression<Func<AspNetUsers, object>>>();
Expression<Func<AspNetUsers, object>> roleInclude = (roles) => roles.AspNetRoles;
include.Add(roleInclude);
string roleName="Admin";
var users = Repository<AspNetUsers>.GetEntityListForQuery(r=>r.AspNetRoles.Where(y=>y.Name == roleName),null,include);

How to write these where clause?

In syntax itself it gives below error:

Cannot implicitly convert type System.Collections.Generic.IEnumerable {AspNetUser} to bool

How to write where clause for another entity?

Related posts

Recent Viewed