Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asp.net mvc diff between DeleteAllOnSubmit and deleteonSubmit

What is the real difference b/w DeleteAllOnSubmit and deleteonSubmit and which one is more appropiate to use?

like image 804
maztt Avatar asked May 10 '26 23:05

maztt


1 Answers

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.)

like image 156
Venemo Avatar answered May 12 '26 15:05

Venemo