public static int GetRequiredFieldIndex( [NotNull] IRow row, [NotNull] Attribute attribute, [CanBeNull] IFieldIndexCache fieldIndexCache = null) { return(GetRequiredFieldIndex(row.Table, attribute, fieldIndexCache)); }
public static T?GetValueFor <T>([NotNull] IRow row, [NotNull] Attribute attribute, [CanBeNull] IFieldIndexCache fieldIndexCache) where T : struct { var fieldIndex = GetRequiredFieldIndex(row, attribute, fieldIndexCache); return(GdbObjectUtils.ConvertRowValue <T>(row, fieldIndex)); }
public static int GetFieldIndex([NotNull] ITable table, [NotNull] Attribute attribute, [CanBeNull] IFieldIndexCache fieldIndexCache = null) { AttributeRole attributeRole = (attribute as ObjectAttribute)?.Role; return (fieldIndexCache?.GetFieldIndex(table, attribute.Name, attributeRole) ?? GetFieldIndex(table, attribute.Name, attributeRole)); }
public static int GetRequiredFieldIndex( [NotNull] ITable table, [NotNull] Attribute attribute, [CanBeNull] IFieldIndexCache fieldIndexCache = null) { int fieldIndex = GetFieldIndex(table, attribute, fieldIndexCache); if (fieldIndex < 0) { _msg.DebugFormat("Missing attribute: {0}", attribute); throw new InvalidOperationException( string.Format("Field {0} not found in table {1}", attribute.Name, DatasetUtils.GetName(table))); } return(fieldIndex); }
public static object GetValueFor([NotNull] IRow row, [NotNull] Attribute attribute, [CanBeNull] IFieldIndexCache fieldIndexCache) { return(row.Value[GetRequiredFieldIndex(row, attribute, fieldIndexCache)]); }