var query = _db.Mst_Users
.Where(item => item.CustomerUserId == customerUserId)
.Traverse(item => _db.Mst_Users.Where(parent => item.CustomerUserId == parent.ParentId))
.Select(item =>Convert.ToString(item.CustomerUserId)).ToArray();
In the above query I'm getting customerUserIds in an array:
int[] ids = query;
From the above int array:
var getgroup = from item in _db.Mst_Group
where ids.Contains(item.CustomerUserId)
select item;
However, it shows the following error:
int[] does not contain a definition for Contains and the best extension method overload system.linq.iqueryable.contains<tsource>