/// <summary>Removes all rows from the table matching the given search.</summary> /// <param name="table">The table.</param> /// <param name="field">The field name to match.</param> /// <param name="value">The value to match.</param> /// <returns>The number of data sets deleted.</returns> public static int TryDelete(this ITable table, string field, object value) { if (table == null) { throw new ArgumentNullException(nameof(table)); } return(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 field name 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) { if (table == null) { throw new ArgumentNullException(nameof(table)); } return(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 field name 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) { if (table == null) { throw new ArgumentNullException(nameof(table)); } return(table.Count(Search.FieldEquals(field, value), ResultOption.None)); }
/// <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 { if (table == null) { throw new ArgumentNullException(nameof(table)); } return(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> /// <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>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>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>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));
/// <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));