trying to obtain anonymous object from IList<object>
Posted on 2009-07-03
I have to use NHibernate and an SQL query (cant use HQL etc.), which means I get a flat table back not typed objects as usual.
Where query is some T-SQL code.
This gives me an IList<object> - so the flat table is represented as a list of objects (rows) which are in fact string arrays containing each rows data (columns).
Usually I am dealing with a typed list (e.g. IList<Item> where item is a simple object with a few fields). So I can create anonymous object like this:
items = from i in list
id = i.ItemId,
cell = new
I would like to do the same but do not know how.
Thanks in adavance,