What I need is to create something like:
- collection -> sortedBy (attribute)
- the string -> at (elementIndex) - in this case I would like to create a method that gives first element in the list that respects some conditions -> firstWhere (attribute).
I searched but did not find anything that could help me.
If someone could provide me with the "sortedBy" and "at" functions it would be great because I think it would cover all my doubts.
Thanks,
Ricardo Jorge
You could write an extended operator that takes in a collection and some type of filter criteria, however you can also accomplish the same with just rules.
This example takes a list of customers, filters for those that are in the State of CA, sorts by age, and then returns the 3rd youngest.
The complete projects is here:
[View:/cfs-file/__key/communityserver-discussions-components-files/14/4300.SortedPosition.zip:320:240]
You could write an extended operator that takes in a collection and some type of filter criteria, however you can also accomplish the same with just rules.
This example takes a list of customers, filters for those that are in the State of CA, sorts by age, and then returns the 3rd youngest.
The complete projects is here:
[View:/cfs-file/__key/communityserver-discussions-components-files/14/4300.SortedPosition.zip:320:240]
Ok, I can do it with the filters.
Thanks.