If I was to grab a distinct list with linq and push this out into a custom class I could do the following:
Dim lStateList As System.Linq.IQueryable(Of CommonBinder)
Dim lStateList
lStateList = From pc In mPostalCodeList _
Select New CommonBinder With {.DisplayMember = pc.State, .ValueMember = pc.State} Distinct
is the shortest way to achieve this with LLBLGen this:
Dim mPostalCodeList As New CollectionClasses.PostcodeCollection
'Retrieve the Postcode List
mPostalCodeList.GetMulti(Nothing)
Dim lStateList As New List(Of CommonBinder)()
Dim allPostcodesView As EntityView(Of EntityClasses.PostcodeEntity) = mPostalCodeList.DefaultView
Dim customClassProjector As New DataProjectorToCustomClass(Of CommonBinder)(lStateList)
Dim propertyProjectors As New List(Of IEntityPropertyProjector)()
propertyProjectors.Add(New EntityPropertyProjector(HelperClasses.PostcodeFields.State, "DisplayMember"))
propertyProjectors.Add(New EntityPropertyProjector(HelperClasses.PostcodeFields.State, "ValueMember"))
' create the projection
allPostcodesView.CreateProjection(propertyProjectors, customClassProjector, False)
Is there any easier way to perform this operation and any way I can get around having to enter names as strings?