[EntityBinder] Supporter les DataRow qui viennent de la recherche.
Opened this issue · 2 comments
Lorsqu'on utilise un KeywordQuery dans un SearchExecutor, on nous retourne des DataTable qui contiennent des DataRow dont les clés sont des ManagedProperties. On doit supporter le mapping vers des entités sachant que nous n'avons pas le SPWeb d'origine, donc pas de SPFieldCollection.
Done, please review 6a6de19
This can't be done until we pimp out the PropertyAttribute so that we can encode the search managed property name (currently, the PropertyAttribute only allows us to map to site column InteralNames).
So, while an initial version the DataRow converters are somewhat ready (during Intact we boosted the SPEntityBinder's performance after CAML queries by relying on SPListItemCollection.ToDataTable()), DataRows that come from search results are not mapped with site column internal names (which will be what happens now). Who knows - maybe the actual DataCell values in CAML and search result contexts are completely different (in which case we may need to develop an entire new set of Search-only DataRow converters to complement the current maybe-CAML-only DataRow converter).
Also, the way you use the StraightConverter definitely isn't what we're aiming for. The correct converter should always be determined by the type of the property decorated with a PropertyAttribute (e.g. an UrlValue on an entity gets to use a UrlValueConverter, not a StraightConverter).