首页 > 解决方案 > Linq-to-SQL SubmitChanges for single object or all objects: What is faster

问题描述

I have a set of filenames which i want to insert in a SQL Table using Linq to SQL. So i create an entity for each filename and add them to the data context using .InsertOnSubmit(...) After that i am doing SubmitChanges() on the context to push the data into my SQL Table.

The second way could be to run SubmitChanges() after each entity creation and push each entity separately to the data base.

Are there any differences in performance between this two ways? If so, which one is faster?

标签: performancelinq-to-sql

解决方案


推荐阅读