Hi,
Is there some function that can delete a list of objects or all the records of the table?
like:
FManager.Remove(TList<TCustomer>) //--> remove the list object
or
FManager.Remove<TCustommer>.All ---> remove all the records of the table
Unfortunately no, there is no such function. You have to call Remove for every item in the list.
From my repository...
procedure TRepositoryBase<TEntity>.RemoveAll;
var
sqlStatement: IDBStatement;
begin
sqlStatement:=FManager.Connection.CreateStatement;
sqlStatement.SetSQLCommand('delete from ' + FManager.Explorer.GetTable(TEntity).Name);
sqlStatement.Execute;
end;
Thanks Altinatas,
That is the way I've use.