Guys,
Seems I was both obscure and verbose and on consideration I'm taking up Frans' suggestions.
So if you want to find a match, create a new collection from the view, then ...
I know this is basic stuff
, but just how do I create a new collection from a view.
You can also loop through the view which is faster
I have a function that returns True if an entity is in a collection.
Public Shared Function EntityInCollection(ByVal collection As IEntityCollection2, ByVal fieldName As String, ByVal key As String) As Boolean
.. but when I try to pass the following
If Utilities.EntityInCollection(CType(BudgetDivisionBindingSource.DataSource, IEntityCollection2), "ProgrammeCode", ID) = True Then
I get this casting error:
Unable to cast object of type 'SD.LLBLGen.Pro.ORMSupportClasses.EntityView2`1[MIS.DAL.EntityClasses.BudgetDivisionEntity]' to type 'SD.LLBLGen.Pro.ORMSupportClasses.IEntityCollection2'.
Note: BudgetDivisionBindingSource.DataSource was populated from a filtered EntityView2.
Not sure how to resolve this.
Thanks