Я пытаюсь реализовать запрос, чтобы найти все Условия на каждом Сайте, которые соответствуют условиям назначающего пользователя, и удалить их - за исключением тех, которые не соответствуют.
var savedPartnerConditions = eipDbContext.EIP_User_Partner_Condition.Where(savedCondition => savedCondition.EIP_User_Partner_Id == savedPartner.EIP_User_Partner_Id && existingUser.CurrentUserConditions.Any(condition => condition.Code == savedCondition.Code));
eipDbContext.EIP_User_Partner_Condition.RemoveRange(savedPartnerConditions);
Но запрос не может быть переведен, что приводит к следующей ошибке:
.Any(condition => condition.Code == e.Code))' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync()
Как создать запрос, чтобы исправить ошибку?