Somewhere in this:
Dim toReturn As New DataTable
Dim propertyProjectors As List(Of IEntityPropertyProjector) = EntityFields2.ConvertToProjectors(entities.EntityFactoryToUse.CreateFields)
entities.DefaultView.CreateProjection(propertyProjectors, toReturn, True, filter)
The order of fields gets reversed. Just a note. Easily fixed on my side with:
propertyProjectors.Sort(New System.Comparison(Of IEntityPropertyProjector)(Function(x As IEntityPropertyProjector, y As IEntityPropertyProjector) (x.DefaultValueProducer.FieldIndex.CompareTo(y.DefaultValueProducer.FieldIndex))))
but just thought you'd like to know.
Jeff...