Open jagregory opened 13 years ago
I'd modify CheckList()
to be indifferent about the order. OTOH, I'm sometimes forced to add ordering in situations like this to fix paging (my database server is sometimes not even consistent about the order of results on a query against the the same data).
This issue is opened yet. Does exist some answer for this question? Cause I having this same problem.
It seems that CheckList enforces ordering on the lists that it checks. I have a many-to-many relationship between Users and Roles as follows:
My testing is as follows:
Sometimes this fails and sometimes it passes. From some debugging, it seems that it is retrieving the Users in a different order than which they were added. I imagine it because the generated Guid (using Guid.Comb) is altering the order on the database query. (I think it is because the guid is not sequential on the association table.) So basically, even though the list contains the same elements, since they are in a different order, fails the test because the source appears to compare elements by index position. So my question is, should I be enforcing an order on my queries or should CheckList not assume ordering on the list?