text: This forum has migrated to Microsoft Q&A. Visit Microsoft Q&A to post new questions.
  Hi,
  I have an EF model class:
  public class X
  {
  public StatusEnum Status { get; set; }
  }
  then, when I'm trying to do:
  query = query.Where(x => x.Status == StatusEnum.Approved);
  This works.
  But when I try to do:
  query = query.Where(x => filter.ColumnStatus.Items.Any(y => (StatusEnum)Enum.Parse(typeof(StatusEnum), y) == x.Status));
  (Items are IEnumerable<string>)
  or even simpler:
  query = query.Where(x => filter.ColumnStatus.Items.Any(y => x.Status == StatusEnum.Approved));
  I'm getting an error:
  "... 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().
  See for more information."
  Hi Michal Urban,
  You can try to change to "(StatusEnum)Enum.Parse(typeof(StatusEnum), y)" to
  Enum.Parse(typeof(StatusEnum), y)
  In general, you can't use x variable in"y => x.Status == StatusEnum.Approved"..