public Record(IResultRow row, RecordTable recordSet) { set = recordSet; values = new object[set.Columns.Count()]; int index = 0; foreach (var col in set.Selectors) { values[index++] = col.GetValueFrom(row); } }
/// <summary> /// Try to parse a row containing a value for this column. /// </summary> /// <parameters> /// <param name="row">The row to parse.</param> /// <param name="value">The value, if parsed successfully.</param> /// </parameters> /// <returns> /// True if parsed successfully, False otherwise and in that case <paramref name="value"/> is unspecified. /// </returns> /// <exception cref="ArgumentNullException"> /// <paramref name="row"/> is null. /// </exception> public bool TryParseRow(IResultRow row, out TEnum value) { if (row == null) { throw new ArgumentNullException(nameof(row)); } if (TryParseRow(row, out Enum EnumValue)) { value = (TEnum)(object)EnumValue; return(true); } else { value = default(TEnum); return(false); } }