Getting a single Entity out of a record Set is much too complicated:
It wold be nice to have a function T RecordSet.ToEntity<t>() This thread was imported from our support forum. The original discussion may contain more detailed answer. Original topic by MSE-iT. |
Alex (Xtensive) wrote:To be done. Btw, we'll provide few overloads for ToEntities<...>() as well. For now it gives a bit surprising results if there are N entities of specified type in a row - i.e. it returns N times more entities (first N - for the first row, second N - for the second one, etc.). This obviously isn't good. otto wrote:For me this extension method works:
Of course it is not optimal, for example keyExtractor is constant for a concrete type, and the references to TypeInfo instances could be also cached. Best regards, Otto[/code] |