I’m using linq.js against a JSON array that I get passed from MVC.
It looks kind of like this..
[{ClAccountNumber : "101" Roles : {blahblahblah}},{ClAccountNumber : "102", Roles : {blahblahblah}}]
The problem I’m having is when I use the following..
var val = Enumerable.From(clAccountsToRole)
.Where("$.ClAccountNumber = 101")
.Select("$.ClAccountNumber")
.ToArray();
My clAccountsToRole gets modified so that every row matches the 101 line. So I get an array of 101, 101.
Has anyone used this library successfully or seen this issue before?
I should note that I’m using FireBug and before the call the array looks fine. And if I remove the Where() part it works fine as well. I’ll get 101, 102 in an array. It’s only when I add the Where that things go wonky.
Don’t you want a comparison operator?