I am trying to load a collection using IEntitySource.GetCollection method. I need to have distinct values in this collection so I am trying to use Distinct() method after loading the collection. However, the next method should use an IEntityCollection. So, I need to have this distinct list in an IEntityCollection type.
Step 1 : GetCollection (This return an IentityCollection)
Step 2 : Fetch distinct values from this collection (Using Distinct() which returns IEnumerable type)
Step 3 : Do something to cast this object from IEnumerable to IEntityCollection)
Step 4 : Use the IEntityCollection for further operation ats the items under this collection would be of IEntity type.
The code read as :
DIm qry As Query = Query.From("TestTable") _
.Where(Function(t) t.Column(Table.TestTable.OrderState) = "Test123") _
.Select("TestKey")
Dim colTest As IEntityCollection = Nothing
colTest = Session.Source.GetCollection(qryTest).Distinct()
- This object colTest is returned as IEnumerable as Distinct is used, but I need to have this as of type IEntityCollection.