DynamicExpression icon indicating copy to clipboard operation
DynamicExpression copied to clipboard

Support for Array Property Type

Open justinush opened this issue 6 years ago • 4 comments

Hi, does it support for Array members type? For example:

myCollection.Where(x => x.Values[0] == "someValue" && x.Values[1] == 12);

justinush avatar Nov 12 '20 01:11 justinush

Yes, that is if I understood correctly. To query collections, use "myCollection[myProperty]". You can't use indexers, cause I wouldn't know how many items is in the collection.

Hope it makes sense.

vivet avatar Nov 12 '20 06:11 vivet

Did you manage to get it to work?

vivet avatar Nov 17 '20 07:11 vivet

Hi, no, I didn't. I use System.Linq.Dynamic.Core to get it to work and use it like this: myCollection.AsQueryable().Where("Values[0].Equals(\"someString\") && Values[1].Equals(\"someString\")").ToList();.

justinush avatar Nov 17 '20 08:11 justinush

I am not sure how you are using it like that. As mentioned the library doesn't support indexers, and for good reason. Maybe if you can add the complete snippet I can assist.

vivet avatar Nov 18 '20 10:11 vivet