What is the real difference b/w DeleteAllOnSubmit and deleteonSubmit and which one is more appropiate to use?
A:
There is no such thing as DeleteOnSubmit
nor DeleteAllOnSubmit
in ASP.NET MVC, so I'll assume that you mean the methods in LINQ to SQL tables. (Correct me if not.)
Basically, you use DeleteOnSubmit
to delete a single row from a table, by specifying a single entity which maps to the row you want to delete.
DeleteAllOnSubmit
is there for you if you want to delete multiple rows from a table, by specifying multiple entities, more correctly an IEnumerable<>
of those, which means that you can specify them in more or less any collection. (List<T>
, Collection<T>
, and many more.)
Venemo
2010-05-21 07:21:59