score:3
Accepted answer
the short answer is: you can't.
you can do something like:
var q = from account in datacontext.accounts
where account.amount < 1000
select account;
datacontext.deleteallonsubmit(q);
but, because the framework needs to track concurrency issues it will always execute separate deletes (so if you have 500 rows that would be deleted, it will send 500 delete statements)
for a longer version and a solution see: http://www.aneyfamily.com/terryandann/post/2008/04/batch-updates-and-deletes-with-linq-to-sql.aspx
Source: stackoverflow.com
Related Query
- Multiple deletions using LINQ (more specifically Linq2Nhibernate, but...)
- How to reuse a linq expression for 'Where' when using multiple source tables
- How can I write the following code more elegantly using LINQ query syntax?
- Implicit operators, Linq and Lambda expressions can make code less readable. But what is more readable?
- Is there a more compact/better way to ZIP multiple lists using LINQ in C#?
- LINQ using multiple .join extensions with multiple (4) or more tables
- Need To Return GroupBy Data With Counts But Selecting Multiple Fields Using LINQ
- Convert string[] to int[] in one line of code using LINQ
- how to update the multiple rows at a time using linq to sql?
- How to select multiple values from a Dictionary using Linq as simple as possible
- Using LINQ to find item in a List but get "Value cannot be null. Parameter name: source"
- linq to sql join on multiple columns using lambda
- Using LINQ to find duplicates across multiple properties
- PagedList using LINQ Skip and Take, but show paging using Count of results
- Using LINQ to group by multiple properties and sum
- Using Linq to do a Contains with multiple values
- using Linq with multiple where conditions
- How to remove an element from an xml using Xdocument when we have multiple elements with same name but different attributes
- how to group by multiple columns using linq
- How do I remove items from generic list, based on multiple conditions and using linq
- Deleting multiple records with Entity Framework using a single LINQ query
- Select Multiple elements in a row using Linq
- Multiple SUM using LINQ
- Using Linq to find duplicates but get the whole record
- Multiple tables left join using Linq
- Does this LINQ code perform multiple lookups on the original data?
- How to combine multiple fields into one field using LINQ
- c # using linq to group by multiple columns in a datatable
- Interleaving multiple (more than 2) irregular lists using LINQ
- Linq - Using array in Lambda expression to fetch multiple records
More Query from same tag
- Linq query and Foreach on large number of records from SQL database
- Why to Apply AsEnumerable() Method to an Array?
- Linq code not working properly
- Get sum of values in between two dates with same month references
- LINQ to Dataset Left Join
- Use Linq to select distinct on a single column then databind repeater VB.net
- Hierarchical grouping data using linq - remove recursion
- Dynamic WPF generation with Linq to XML
- Reusing ordering logic
- how to get rid of try/catch and improve the C# query?
- Computed property with AutoMapper
- linq expression cannot contain lamba expressions exception
- Merge list elements if date differs by one day
- Populating a Dictionary with LINQ to XML
- Count child record and show zero if empty
- Using a Dictionary in a linq query inside Contains method
- reset count above max time interval, in Rx count-based aggregation
- Read a specific Element Value based on a specific Attribute in Linq?
- Compare lists and return objects that doesn't exist
- Unable to Insert Char(63) by SQL query
- Use Linq to Parse out XML Sibling Node - C#
- Debugging LINQ on a per-element basis
- Using LINQ expressions for custom data types
- Get max DataGridViewRow based on Record ID using LINQ
- Select Value from Dictionary if Key exists using LINQ
- How can I create a method that will print LINQ query results?
- How to remove instances from a List, which don't contain objects that match values from a Dictionary?
- weird result when using linq to set value
- Episode 77 - links instead of a for loop
- Is it possible to databind directly from a linq query result to a control?