Achieving LINQ functionality in ObjectScript
WRF to below example my idea is to check whether red is present in the list mylist. You can very well use LINQ on enumerable in C#
mylist.Where(x => (x.Property2 == "red")).ToList().Count;
set mylist=##class(%ListOfObjects).%New() For i=1:1:2 { S object = ##class(User.NewClass).%New() S object.Property1=i S object.Property2="red" do mylist.Insert(object) }
It can be done with iterating over mylist
for j=1:1:mylist.Count(){ Set item = mylist.GetAt(j) If (item.Property1 = "red") { // get the count } //set exist = item.Find("viv",1) }