asp.net mvcDeleteAllOnSubmit和deleteonSubmit之间的差异
DeleteAllOnSubmit 和 deleteonSubmit 之间的真正区别是什么?哪一个更适合使用?
What is the real difference b/w DeleteAllOnSubmit and deleteonSubmit and which one is more appropiate to use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ASP.NET MVC 中没有
DeleteOnSubmit
和DeleteAllOnSubmit
之类的东西,因此我假设您指的是 LINQ to SQL 表中的方法。 (如果没有,请纠正我。)基本上,您可以使用
DeleteOnSubmit
通过指定映射到要删除的行的单个实体来从表中删除单行。如果您想通过指定多个实体(更准确地说是其中的
IEnumerable<>
)从表中删除多行,DeleteAllOnSubmit
可以满足您的需要,这意味着您可以在或多或少的任何集合中指定它们。 (List
、Collection
等等。)There is no such thing as
DeleteOnSubmit
norDeleteAllOnSubmit
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 anIEnumerable<>
of those, which means that you can specify them in more or less any collection. (List<T>
,Collection<T>
, and many more.)