I would like to filter array of users, based on that if roles that exists in array are already contained in user roles list.
Here is my code which won't compile:
var roles = role.Split(','); // admin, basic, super-admin
listOfUsers = listOfUsers.Where(user => user.Roles.Contains(roles.Select(x => x)).ToList();
I want to do if admin and basic are contained in roles which is array of string to return only those users which have the same value in Roles array. (Roles is also list of strings) but this reproduces an error:

listOfUsers, etc? what type isuser.Roles?roles, or users that have ANY role inroles?Rolesis also aList<string>Rolesis also aList<string>user.Rolesis anIEnumerable<string>, thenuser.Roles.Contains(roles.Select(x => x))expects astringas a parameter. We know thatrolesis astring[](assuming thatroleis a string containing stuff separated by commas). Then,roles.Select(x=>x)is anIEnumerable<string>not thestringthe function expects. This would be much easier if you gave us more code (as suggested by @DavidFox) and if your variable names weren'trole,rolesandRoles