Projection from a datatable to an EntityCollection

Posts   
 
    
JimHugh
User
Posts: 191
Joined: 16-Nov-2005
# Posted on: 07-Sep-2006 23:12:56   

Would it make any sense to add one more overload to the FetchProjection method on the DataAccessAdapter object that used a DataTable instead of a DataReader?


adapter.FetchProjection( valueProjectors, projector, datatable );

I realize in this case it would not actually go out to the database to do a query, but it seems easier than creating another class.

I can make a use case where a datatable gets populated, serialized, transmitted, deserialized back to a datatable at which point it needs to get projected onto an entity collection for validation, business processing and finally persisting to a database.

Sure I can write the code to do that, just wanted to offer it as a core suggestion.

Unless of course there is already a way to populate an entity collection from a datatable and I missed it in the docs...

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 08-Sep-2006 09:43:57   

Very old thread, which contains a small routine which should do the trick: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=453 simple_smile You might want to use the column names as indexers instead to make it more robust.

Frans Bouma | Lead developer LLBLGen Pro