protected static DeleteAll ( |
||
type | ActiveRecord type on which the rows on the database should be deleted | |
return | void |
protected internal static void DeleteAll(Type type)
{
EnsureInitialized(type);
ISession session = holder.CreateSession(type);
try
{
session.Delete(String.Format("from {0}", type.Name));
session.Flush();
}
catch (ValidationException)
{
holder.FailSession(session);
throw;
}
catch (Exception ex)
{
holder.FailSession(session);
throw new ActiveRecordException("Could not perform DeleteAll for " + type.Name, ex);
}
finally
{
holder.ReleaseSession(session);
}
}
public static void DeleteAll() { ActiveRecordBase.DeleteAll(typeof(T)); }