Tuesday, February 14, 2012

How to delete all items from a table in Castle ActiveRecord

Suppose you have a table named Customer for example then to delete all rows from a table in Castle ActiveRecord call the following method defined in the table class:

public static void DeleteAll()
 {
     DeleteAll(typeof(Customer));
 }

Note that you can't call DeleteAll(typeof(Customer)) directly from any class because it's defined as private.

No comments:

Post a Comment