I'm trying to check does the values of (string[]) contains in string. When I run the code only first value of string separated with comma is check. I want to check all values of string.
// Model property (User)
// Example 1002, 5000, 3300 (Skills ids)
public string userSkillsId { get; set; }
// Index filtering with multiple values(select2)
// Example 1002, 5000 (Skills ids to check if contains in userSkillsId)
public string SkillsId { get; set; }
public async Task<IActionResult> Index(ContestantViewModel viewModel, int currentPage)
{
string[] skills = viewModel.SkillsId?.Split(",");
if (!(viewModel.SkillsId is null))
entity = entity.Where(x => ((IList)skills).Contains(x.userSkillsId));
viewModel.Result = result;
}