public IEnumerable Deserialize(IDataReader reader, ColumnChecker columnReport)
 {
     while (reader.Read())
     {
         yield return _compiledMap(reader, columnReport);
     }
 }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DynamicRow" /> class.
        /// </summary>
        /// <param name="columns">The columns Susanoo has discovered and will map to properties.</param>
        /// <param name="values">The values.</param>
        /// <exception cref="System.IndexOutOfRangeException">
        /// Thrown if column count and value count do not match.
        /// </exception>
        public DynamicRow(ColumnChecker columns, object[] values)
        {
            if (columns.Count != values.Length)
                throw new IndexOutOfRangeException();

            _columns = columns;
            _values = values;
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DynamicRow"/> class.
 /// </summary>
 public DynamicRow()
 {
     _columns = new ColumnChecker(0);
     _values = new object[_columns.Count];
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.Dynamic.DynamicMetaObject" /> class.
 /// </summary>
 /// <param name="expression">
 /// The expression representing this <see cref="T:System.Dynamic.DynamicMetaObject" /> during the dynamic binding process.
 /// </param>
 /// <param name="restrictions">The set of binding restrictions under which the binding is valid.</param>
 /// <param name="value">The runtime value represented by the <see cref="T:System.Dynamic.DynamicMetaObject" />.</param>
 /// <param name="columns">The columns.</param>
 public DynamicRowMeta(Expression expression, BindingRestrictions restrictions, object value, ColumnChecker columns)
     : base(expression, restrictions, value)
 {
     _columns = columns;
 }
 /// <summary>
 /// Clears any column index information that may have been cached.
 /// </summary>
 public override void ClearColumnIndexInfo()
 {
     _columnChecker = new ColumnChecker();
 }
Example #6
0
 /// <summary>
 /// Deserializes the reader into a collection of objects.
 /// </summary>
 /// <param name="reader">The reader.</param>
 /// <param name="columnReport">The column report.</param>
 /// <returns>IEnumerable.</returns>
 public IEnumerable Deserialize(IDataReader reader, ColumnChecker columnReport)
 {
     return _deserializer(reader, columnReport);
 }