DataUtils.DataReaderToIEnumerable<T>

Creates an IEnumerable of T from an open DataReader instance.

Note this method uses Reflection so this isn't a high performance operation, but it can be useful for generic data reader to entity conversions on the fly and with anonymous types.

public static IEnumerable<T> DataReaderToIEnumerable<T>(IDataReader reader,
	string propertiesToSkip,
	Dictionary<String,PropertyInfo> piList)

Parameters

reader
An open DataReader that's in position to read

propertiesToSkip
Optional - comma delimited list of fields that you don't want to update

piList
Optional - Cached PropertyInfo dictionary that holds property info data for this object. Can be used for caching hte PropertyInfo structure for multiple operations to speed up translation. If not passed automatically created.


See also:

Class DataUtils

© West Wind Technologies, 2019 • Updated: 06/23/19
Comment or report problem with topic