/// <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));
Ejemplo n.º 5
0
 /// <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));
Ejemplo n.º 6
0
 /// <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));
Ejemplo n.º 7
0
 /// <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));
Ejemplo n.º 8
0
 /// <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);
Ejemplo n.º 9
0
 /// <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));
Ejemplo n.º 10
0
 /// <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));
Ejemplo n.º 11
0
 /// <inheritdoc />
 public abstract long Count(Search search = default, ResultOption resultOption = default);
Ejemplo n.º 12
0
 /// <inheritdoc />
 public abstract IList <Row> GetRows(Search search = default, ResultOption resultOption = default);
Ejemplo n.º 13
0
 /// <inheritdoc />
 public abstract Row GetRow(Search search = default, ResultOption resultOption = default);
Ejemplo n.º 14
0
 /// <inheritdoc />
 public abstract int TryDelete(Search search);
Ejemplo n.º 15
0
 /// <inheritdoc />
 public abstract bool Exist(Search search);