Lambda Contains in SimpleRepository.Find
- by Anton
In SubSonic 3.04's SimpleRepository, I cannot seem to perform a Contains operation within a lambda expression. Here's a trivial example:
SimpleRepository repo = new SimpleRepository("ConnectionString");
List<int> userIds = new List<int>();
userIds.Add(1);
userIds.Add(3);
List<User> users = repo.Find<User>(x => userIds.Contains(x.Id)).ToList();
I get the error message:
variable 'x' of type 'User' referenced from scope '', but it is not defined
Am I missing something here, or does SubSonic not support Contains in lambda expressions? If not, how would this be done?