❔ Refactor help`
Can this be written as a Linq expression?
I've been trying but I keep failing at it. I'm not as great with Linq...
I've been trying but I keep failing at it. I'm not as great with Linq...
foreach (Assignment item in _assignments)
{
foreach (AssignedUser user in item.AssigneeId)
{
if (user.UserId != _user.MicrosoftId)
{
_assignmentsNotOnUser.Add(item);
}
}
}anyclause equals true.user.UserId != _user.MicrosoftId./close user.UserId != _user.MicrosoftId_assignmentsNotOnUser = _assignments
.Where(x => x.AssigneeIds
.Any(y => y.UserId != _user.MicrosoftId))
.ToList();