public MemoryDataRecord(IDataRecord record, string[] colnames, int depth) { if (record == null) { throw new ArgumentNullException(nameof(record)); } this._values = new object[record.FieldCount]; for (int fi = 0; fi < this._values.Length; fi++) { this._values[fi] = MemoryDataHelper.GetCopyFrom(record[fi]); } if (colnames == null) { this._names = Array.Empty <string>(); } else { this._names = colnames; } this._depth = depth; }
public MemoryDataRecord(object[] list) { if (list == null) { throw new ArgumentNullException(nameof(list)); } this._values = new object[list.Length]; this._names = Array.Empty <string>(); for (int fi = 0; fi < this._values.Length; fi++) { this._values[fi] = MemoryDataHelper.GetCopyFrom(list[fi]); } }
public MemoryDataRecord(IDictionary dict) { if (dict == null) { throw new ArgumentNullException(nameof(dict)); } this._values = new object[dict.Count]; this._names = new string[dict.Count]; int index = 0; foreach (object fKey in dict.Keys) { this._values[index] = MemoryDataHelper.GetCopyFrom(dict[fKey]); this._names[index] = fKey.ToString(); index++; } }