Delete all records from a table

How can I delete all records from a table using SubSonic? The Delete method has three overloads, but each of them expects some parameters. And how can I delete records using query (for example delete all records where column1> 100)

0


a source to share


2 answers


Further, all lines from TempTable will be deleted, which have Id greater than 56:



new Delete().From(TempTable.Schema)
  .Where(TempTable.Columns.Id).IsGreaterThan(56)
  .Execute();

      

+3


a source


Help is located at http://subsonicproject.com/docs/Main_Page and many examples for this are in the tests included in the source.



int records = new Delete().From(Product.Schema)
    .Where("UnitPrice")
    .IsGreaterThan(42.00)
    .Execute();

// Delete all rows.
int records = new Delete().From(Product.Schema).Execute();

      

+1


a source







All Articles