/// <inheritdoc /> public IList <TStruct> GetStructs(IEnumerable <TKey> ids) => GetRows(Search.FieldIn(KeyField.Name, ids)).Select(r => r.GetStruct <TStruct>(Layout)).ToList();
/// <inheritdoc /> public IDictionary <TKey, TStruct> GetDictionary(Search search = null, ResultOption resultOption = null) => GetRows(search, resultOption).ToDictionary(r => (TKey)r[KeyField.Index], r => r.GetStruct <TStruct>(Layout));
/// <inheritdoc /> public void Delete(IEnumerable <TKey> ids) => BaseTable.TryDelete(Search.FieldIn(KeyField.Name, ids));
/// <inheritdoc /> public IList <Row> GetRows(IEnumerable <TKey> ids) => BaseTable.GetRows(Search.FieldIn(KeyField.Name, ids));
/// <summary>Searches the table for rows with given field value combinations.</summary> /// <typeparam name="TStruct">Structure type.</typeparam> /// <param name="table">The table.</param> /// <param name="field">The fieldname to match.</param> /// <param name="value">The value to match.</param> /// <returns>The rows found.</returns> public static IList <TStruct> GetStructs <TStruct>(this ITable <TStruct> table, string field, object value) where TStruct : struct => table.GetStructs(Search.FieldEquals(field, value));
/// <summary>Removes all rows from the table matching the given search.</summary> /// <param name="table">The table.</param> /// <param name="field">The fieldname to match.</param> /// <param name="value">The value to match.</param> /// <returns>The number of datasets deleted.</returns> public static int TryDelete(this ITable table, string field, object value) => table.TryDelete(Search.FieldEquals(field, value));
/// <summary>Searches the table for rows with given field value combinations.</summary> /// <param name="table">The table.</param> /// <param name="field">The fieldname to match.</param> /// <param name="value">The value to match.</param> /// <returns>The rows found.</returns> public static IList <Row> GetRows(this ITable table, string field, object value) => table.GetRows(Search.FieldEquals(field, value));
/// <summary>Counts the rows with specified field value combination.</summary> /// <param name="table">The table.</param> /// <param name="field">The fieldname to match.</param> /// <param name="value">The value to match.</param> /// <returns>The number of rows found matching the criteria given.</returns> public static long Count(this ITable table, string field, object value) => table.Count(Search.FieldEquals(field, value), ResultOption.None);
/// <summary>Checks a given search for any datasets matching.</summary> /// <param name="table">The table.</param> /// <param name="field">The fields name.</param> /// <param name="value">The value.</param> /// <returns>Returns true if a dataset exists, false otherwise.</returns> public static bool Exist(this ITable table, string field, object value) => table.Exist(Search.FieldEquals(field, value));
/// <summary>Searches the table for a single row with given field value combination.</summary> /// <param name="table">The table.</param> /// <param name="field">The fieldname to match.</param> /// <param name="value">The value to match.</param> /// <returns>The row found.</returns> public static Row GetRow(this ITable table, string field, object value) => table.GetRow(Search.FieldEquals(field, value));
/// <inheritdoc /> public abstract long Count(Search search = default, ResultOption resultOption = default);
/// <inheritdoc /> public abstract IList <Row> GetRows(Search search = default, ResultOption resultOption = default);
/// <inheritdoc /> public abstract Row GetRow(Search search = default, ResultOption resultOption = default);
/// <inheritdoc /> public abstract int TryDelete(Search search);
/// <inheritdoc /> public abstract bool Exist(Search search);