I have to list created from database using entity framework LINQ queries
class Users {
string id { get; set; }
}
class Permission
{
string permission id { get; set;}
User theUser { get; set; }
}
var allUsers = db.Users.ToList();
// This returns a list of ids ["1","2","3"]
var usersWithPermission = db.Permission.Where(x => x.User.Id.Contains(users));
I want to retrieve the users with permission, I am trying to get all the records from the permission table and then retrieve any of them that contains the id the id of the "AllUsers" list.
Thanks, Any help will be appreciate it
..Permission.Where (x => allUsers.Contains (x.User.Id))