public bool Equals(DbRowObjectMap other) { if (other is null) { return(false); } if (other.Count != Count) { return(false); } for (int i = Count - 1; i >= 0; i--) { if (this[i].Key != other[i].Key) { return(false); } if (this[i].Value != other[i].Value) { return(false); } } return(true); }
internal static DbRowObjectMap CreateMap(DbDataReader dbDataReader) { var map = new DbRowObjectMap { Capacity = dbDataReader.FieldCount }; for (int i = 0; i < dbDataReader.FieldCount; i++) { map.Add(dbDataReader.GetName(i), RW.ValueInterface.GetInterface(dbDataReader.GetFieldType(i))); } return(map); }
internal static DbRowObject ValueOf(DbDataReader dbDataReader, DbRowObjectMap dbRowObjectMap) { var values = new object[dbRowObjectMap.Count]; for (int i = 0; i < values.Length; i++) { var value = dbDataReader[i]; if (value == DBNull.Value) { value = null; } values[i] = value; } return(new DbRowObject(dbRowObjectMap, values)); }
internal DbRowObject(DbRowObjectMap map, object[] values) { Map = map; Values = values; }