Avoid calling ToString . You want something like this:
userIds.Contains(user.Id)
To do this, the userIds list must be a collection of the type that user.Id has. If you need integers, use int.Parse to convert strings to integers:
int[] userIds = userList.Split(',').Select(s => int.Parse(s)).ToArray();
Mark Byers Nov 08 2018-10-11T00: 00Z
source share