#nullable enable using System; using System.Collections; namespace BCG { /// /// Represents a primitive immutable anologue of a dotNet DataRow. The user assumes no info about the row /// but the number of columns, and the way to access data through the indexer by providing either the /// ordinal or the name. Also note that the default iteration through the IBlueRow return DictionaryEntry /// (ie the default iteration is the same as an IDictionary's iteration) /// public interface IBlueRow : IDictionary { /// /// Gets the schema of the row, which is same as that of the IBlueRowCollections to which it belongs /// IBlueTableSchema schema{get;} /// /// Though the IDictionary supports an untyped indexer, having the typed indexer makes retreivals /// faster, specially in the case of large tables, where one type checking per cell would amount to /// a sizeable time, eg for a table with 20000 rows and a schema of 20 columns, we will save about /// half a million type checkings /// object? this[int index] {get;} object? this[string colName] {get;} } namespace Extensions { public static class IBlueRowExtensions { public static bool isDBNull(this object? val) { return (val == null || val == DBNull.Value); } public static bool isNotDBNull(this object? val) { return (val != null && val != DBNull.Value); } } } }